diff --git a/library/HTMLPurifier/Lexer.php b/library/HTMLPurifier/Lexer.php index c1b83d18..57950254 100644 --- a/library/HTMLPurifier/Lexer.php +++ b/library/HTMLPurifier/Lexer.php @@ -274,7 +274,6 @@ class HTMLPurifier_Lexer * Special CDATA case that is especiall convoluted for )#si', + array('HTMLPurifier_Lexer_DirectLex', 'scriptCallback'), $html); + } + $html = $this->normalize($html, $config, $context); $cursor = 0; // our location in the text diff --git a/tests/HTMLPurifier/HTMLModule/ScriptingTest.php b/tests/HTMLPurifier/HTMLModule/ScriptingTest.php index 1f06b2a5..ce108f7b 100644 --- a/tests/HTMLPurifier/HTMLModule/ScriptingTest.php +++ b/tests/HTMLPurifier/HTMLModule/ScriptingTest.php @@ -46,13 +46,6 @@ alert(""); array('HTML.Trusted' => true, 'Core.CommentScriptContents' => false) ); - // invalid children - $this->assertResult( - '', - '', - array('HTML.Trusted' => true, 'Core.CommentScriptContents' => false) - ); - } } diff --git a/tests/HTMLPurifier/LexerTest.php b/tests/HTMLPurifier/LexerTest.php index d250493a..f80159be 100644 --- a/tests/HTMLPurifier/LexerTest.php +++ b/tests/HTMLPurifier/LexerTest.php @@ -315,6 +315,17 @@ class HTMLPurifier_LexerTest extends UnitTestCase $sax_expect[21] = false; $dom_expect[21] = false; + // test CDATA tags + $input[22] = ''; + $expect[22] = array( + new HTMLPurifier_Token_Start('script') + ,new HTMLPurifier_Token_Text('alert("");') + ,new HTMLPurifier_Token_End('script') + ); + $config[22] = HTMLPurifier_Config::create(array('HTML.Trusted' => true)); + $sax_expect[22] = false; + //$dom_expect[22] = false; + $default_config = HTMLPurifier_Config::createDefault(); $default_context = new HTMLPurifier_Context(); foreach($input as $i => $discard) {