mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-31 19:30:21 +02:00
[1.7.0] Contents between <script> tags are now completely removed if <script> is not allowed
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1145 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -7,9 +7,9 @@ class HTMLPurifier_HTMLModule_ScriptingTest extends HTMLPurifier_HTMLModuleHarne
|
||||
|
||||
function test() {
|
||||
|
||||
// default
|
||||
// default (remove everything)
|
||||
$this->assertResult(
|
||||
'<script type="text/javascript">foo();</script>', 'foo();'
|
||||
'<script type="text/javascript">foo();</script>', ''
|
||||
);
|
||||
|
||||
// enabled
|
||||
|
@@ -25,6 +25,17 @@ class HTMLPurifier_Strategy_RemoveForeignElementsTest
|
||||
'BlingBong'
|
||||
);
|
||||
|
||||
$this->assertResult(
|
||||
'<script>alert();</script>',
|
||||
''
|
||||
);
|
||||
|
||||
$this->assertResult(
|
||||
'<script>alert();</script>',
|
||||
'alert();',
|
||||
array('Core.RemoveScriptContents' => false)
|
||||
);
|
||||
|
||||
$this->assertResult(
|
||||
'<menu><li>Item 1</li></menu>',
|
||||
'<ul><li>Item 1</li></ul>'
|
||||
|
@@ -76,7 +76,7 @@ class HTMLPurifierTest extends UnitTestCase
|
||||
$this->purifier->purifyArray(
|
||||
array('Good', '<b>Sketchy', 'foo' => '<script>bad</script>')
|
||||
),
|
||||
array('Good', '<b>Sketchy</b>', 'foo' => 'bad')
|
||||
array('Good', '<b>Sketchy</b>', 'foo' => '')
|
||||
);
|
||||
|
||||
$this->assertIsA($this->purifier->context, 'array');
|
||||
|
Reference in New Issue
Block a user