mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-29 15:22:15 +09:00
Improve HTMLFilter handling of editor component properties
This commit is contained in:
parent
24c29cfbdb
commit
aa879e7326
2 changed files with 15 additions and 2 deletions
|
|
@ -187,6 +187,14 @@ class HTMLFilterTest extends \Codeception\TestCase\Test
|
|||
$target = '<img src="./foo/bar.jpg" alt="My Picture" style="width:320px;height:240px;" width="320" height="240" />';
|
||||
$this->assertEquals($target, Rhymix\Framework\Filters\HTMLFilter::clean($source, false, false));
|
||||
|
||||
$source = '<img src="./foo/bar.jpg" alt="Picture" editor_component="component_name" editor_component_property="java Script:alert()" />';
|
||||
$target = '<img src="./foo/bar.jpg" alt="Picture" editor_component="component_name" />';
|
||||
$this->assertEquals($target, Rhymix\Framework\Filters\HTMLFilter::clean($source));
|
||||
|
||||
$source = '<img src="./foo/bar.jpg" alt="Picture" editor_component="component_name" rx_encoded_properties="alert()" />';
|
||||
$target = '<img src="./foo/bar.jpg" alt="Picture" editor_component="component_name" />';
|
||||
$this->assertEquals($target, Rhymix\Framework\Filters\HTMLFilter::clean($source));
|
||||
|
||||
$source = '<img somekey="somevalue" otherkey="othervalue" onkeypress="alert(\'xss\');" editor_component="component_name" />';
|
||||
$target = '';
|
||||
$this->assertEquals($target, Rhymix\Framework\Filters\HTMLFilter::clean($source, false, false));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue