mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-12-22 08:21:52 +00:00
Add integration test, and fix broken SecureMunge
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1774 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
parent
8d1f1e8e73
commit
36fb284d2f
@ -28,6 +28,7 @@ class HTMLPurifier_URIDefinition extends HTMLPurifier_Definition
|
||||
$this->registerFilter(new HTMLPurifier_URIFilter_DisableExternalResources());
|
||||
$this->registerFilter(new HTMLPurifier_URIFilter_HostBlacklist());
|
||||
$this->registerFilter(new HTMLPurifier_URIFilter_MakeAbsolute());
|
||||
$this->registerFilter(new HTMLPurifier_URIFilter_SecureMunge());
|
||||
}
|
||||
|
||||
public function registerFilter($filter) {
|
||||
|
@ -185,5 +185,14 @@ alert("<This is compatible with XHTML>");
|
||||
);
|
||||
}
|
||||
|
||||
function test_secureMunge() {
|
||||
$this->config->set('URI', 'SecureMunge', '/redirect.php?url=%s&check=%t');
|
||||
$this->config->set('URI', 'SecureMungeSecretKey', 'foo');
|
||||
$this->assertPurification(
|
||||
'<a href="http://localhost">foo</a>',
|
||||
'<a href="/redirect.php?url=http%3A%2F%2Flocalhost&check=8e8223ae8fac24561104180ea549c21fbd111be7">foo</a>'
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user