0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-12-22 16:31:53 +00:00

Actually make URI.DisableResources do something.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
This commit is contained in:
Edward Z. Yang 2012-03-02 13:25:00 -05:00
parent 8c9d461a62
commit 31dce298ea
2 changed files with 6 additions and 0 deletions

View File

@ -26,6 +26,7 @@ class HTMLPurifier_URIDefinition extends HTMLPurifier_Definition
public function __construct() {
$this->registerFilter(new HTMLPurifier_URIFilter_DisableExternal());
$this->registerFilter(new HTMLPurifier_URIFilter_DisableExternalResources());
$this->registerFilter(new HTMLPurifier_URIFilter_DisableResources());
$this->registerFilter(new HTMLPurifier_URIFilter_HostBlacklist());
$this->registerFilter(new HTMLPurifier_URIFilter_SafeIframe());
$this->registerFilter(new HTMLPurifier_URIFilter_MakeAbsolute());

View File

@ -36,6 +36,11 @@ class HTMLPurifierTest extends HTMLPurifier_Harness
);
}
function testDisableResources() {
$this->config->set('URI.DisableResources', true);
$this->assertPurification('<img src="foo.jpg" />', '');
}
function test_addFilter_deprecated() {
$this->expectError('HTMLPurifier->addFilter() is deprecated, use configuration directives in the Filter namespace or Filter.Custom');
generate_mock_once('HTMLPurifier_Filter');