mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-11-09 15:28:40 +00:00
[2.1.1] Fix show-stopping bug in URIDefinition.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1361 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
parent
b3aa5fa0dc
commit
7b64bc37e2
1
NEWS
1
NEWS
@ -13,6 +13,7 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier
|
||||
[ no items ]
|
||||
|
||||
2.1.1, unknown release date
|
||||
- Fix show-stopper bug in %URI.MakeAbsolute functionality
|
||||
. Add prefix directory to include path for standalone, this prevents
|
||||
other installations from clobbering the standalone's URI schemes
|
||||
|
||||
|
@ -103,23 +103,22 @@ class HTMLPurifier_URIDefinition extends HTMLPurifier_Definition
|
||||
}
|
||||
|
||||
function addFilter($filter, $config) {
|
||||
$filter->setup($config);
|
||||
$filter->prepare($config);
|
||||
$this->filter[$filter->name] = $filter;
|
||||
}
|
||||
|
||||
function doSetup($config) {
|
||||
$this->setupFilters($config);
|
||||
$this->setupMemberVariables($config);
|
||||
$this->setupFilters($config);
|
||||
}
|
||||
|
||||
function setupFilters($config) {
|
||||
foreach ($this->registeredFilters as $name => $filter) {
|
||||
$conf = $config->get('URI', $name);
|
||||
if ($conf !== false && $conf !== null) {
|
||||
$this->filters[$name] = $filter;
|
||||
$this->addFilter($filter, $config);
|
||||
}
|
||||
}
|
||||
foreach ($this->filters as $n => $x) $this->filters[$n]->prepare($config);
|
||||
unset($this->registeredFilters);
|
||||
}
|
||||
|
||||
|
@ -138,5 +138,16 @@ alert("<This is compatible with XHTML>");
|
||||
$this->assertReference($purifier, $purifier2);
|
||||
}
|
||||
|
||||
function testMakeAbsolute() {
|
||||
$this->assertPurification(
|
||||
'<a href="foo.txt">Foobar</a>',
|
||||
'<a href="http://example.com/bar/foo.txt">Foobar</a>',
|
||||
array(
|
||||
'URI.Base' => 'http://example.com/bar/baz.php',
|
||||
'URI.MakeAbsolute' => true
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user