From 31dce298eac1b71fd7a7590e74062cba4a37a43d Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Fri, 2 Mar 2012 13:25:00 -0500 Subject: [PATCH] Actually make URI.DisableResources do something. Signed-off-by: Edward Z. Yang --- library/HTMLPurifier/URIDefinition.php | 1 + tests/HTMLPurifierTest.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/library/HTMLPurifier/URIDefinition.php b/library/HTMLPurifier/URIDefinition.php index 40e57bb7..4dbde806 100644 --- a/library/HTMLPurifier/URIDefinition.php +++ b/library/HTMLPurifier/URIDefinition.php @@ -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()); diff --git a/tests/HTMLPurifierTest.php b/tests/HTMLPurifierTest.php index 4fe8f068..5d61c1aa 100644 --- a/tests/HTMLPurifierTest.php +++ b/tests/HTMLPurifierTest.php @@ -36,6 +36,11 @@ class HTMLPurifierTest extends HTMLPurifier_Harness ); } + function testDisableResources() { + $this->config->set('URI.DisableResources', true); + $this->assertPurification('', ''); + } + 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');