Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@ jobs:
- name: Configure simpletest
run: cp test-settings.sample.php test-settings.php

- name: Fix PHP 8.5 imcompatibility in simpletest
run: cp tests/patches/simpletest-errors.php vendor/simpletest/simpletest/src/errors.php

- name: Execute Unit tests
run: php tests/index.php
19 changes: 0 additions & 19 deletions .github/workflows/lint-pr.yml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/release.yml

This file was deleted.

11 changes: 2 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"require-dev": {
"cerdic/css-tidy": "^1.7 || ^2.0",
"simpletest/simpletest": "dev-master"
"simpletest/simpletest": "v1.3.0"
},
"autoload": {
"psr-0": { "HTMLPurifier": "library/" },
Expand All @@ -34,12 +34,5 @@
},
"config": {
"sort-packages": true
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/ezyang/simpletest.git",
"no-api": true
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function handleElement(&$token)

if ($current instanceof HTMLPurifier_Token_End && $current->name === 'span') {
// Mark closing span tag for deletion
$this->markForDeletion->attach($current);
$this->markForDeletion->offsetSet($current);
// Delete open span tag
$token = false;
}
Expand All @@ -85,8 +85,8 @@ public function handleElement(&$token)
*/
public function handleEnd(&$token)
{
if ($this->markForDeletion->contains($token)) {
$this->markForDeletion->detach($token);
if ($this->markForDeletion->offsetExists($token)) {
$this->markForDeletion->offsetUnset($token);
$token = false;
}
}
Expand Down
5 changes: 4 additions & 1 deletion library/HTMLPurifier/URISchemeRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static function instance($prototype = null)

/**
* Retrieves a scheme validator object
* @param string $scheme String scheme name like http or mailto
* @param string|null $scheme String scheme name like http or mailto
* @param HTMLPurifier_Config $config
* @param HTMLPurifier_Context $context
* @return HTMLPurifier_URIScheme
Expand All @@ -52,6 +52,9 @@ public function getScheme($scheme, $config, $context)
return;
}

if ($scheme === null) {
return;
}
if (isset($this->schemes[$scheme])) {
return $this->schemes[$scheme];
}
Expand Down
2 changes: 1 addition & 1 deletion tests/HTMLPurifier/DefinitionCacheFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function test_create_recycling()
{
$cache = $this->factory->create('Test', $this->config);
$cache2 = $this->factory->create('Test', $this->config);
$this->assertReference($cache, $cache2);
$this->assertSame($cache, $cache2);
}

public function test_create_invalid()
Expand Down
4 changes: 2 additions & 2 deletions tests/HTMLPurifier/HTMLModuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function test_addElement()

$this->assertIdentical($module, $module2);
$this->assertIdentical($def, $def2);
$this->assertReference($def, $module->info['a']);
$this->assertSame($def, $module->info['a']);

}

Expand Down Expand Up @@ -112,7 +112,7 @@ public function test_addBlankElement()
$def2 = new HTMLPurifier_ElementDef();
$def2->standalone = false;

$this->assertReference($module->info['a'], $def);
$this->assertSame($module->info['a'], $def);
$this->assertIdentical($def, $def2);

}
Expand Down
2 changes: 1 addition & 1 deletion tests/HTMLPurifierTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function testGetInstance()
{
$purifier = HTMLPurifier::getInstance();
$purifier2 = HTMLPurifier::getInstance();
$this->assertReference($purifier, $purifier2);
$this->assertSame($purifier, $purifier2);
}

public function testMakeAbsolute()
Expand Down
Loading
Loading