mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-31 03:10:09 +02:00
[2.0.1] Fix DirectLex's incomprehension of un-armored script contents as CDATA using custom preg_replace_callback
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1244 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -46,13 +46,6 @@ alert("<This is compatible with XHTML>");
|
||||
array('HTML.Trusted' => true, 'Core.CommentScriptContents' => false)
|
||||
);
|
||||
|
||||
// invalid children
|
||||
$this->assertResult(
|
||||
'<script type="text/javascript">PCDATA<span</script>',
|
||||
'<script type="text/javascript">PCDATA</script>',
|
||||
array('HTML.Trusted' => true, 'Core.CommentScriptContents' => false)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -315,6 +315,17 @@ class HTMLPurifier_LexerTest extends UnitTestCase
|
||||
$sax_expect[21] = false;
|
||||
$dom_expect[21] = false;
|
||||
|
||||
// test CDATA tags
|
||||
$input[22] = '<script>alert("<foo>");</script>';
|
||||
$expect[22] = array(
|
||||
new HTMLPurifier_Token_Start('script')
|
||||
,new HTMLPurifier_Token_Text('alert("<foo>");')
|
||||
,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) {
|
||||
|
Reference in New Issue
Block a user