Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Tests/InputFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,12 @@ public function casesGeneric()
'<img />',
'From generic cases',
],
'Kill script with newline entity' => [
'',
'<img src="java&NewLine;script:alert();" />',
'<img />',
'From generic cases',
],
'Nested tags' => [
'',
'<em><strong>Fred</strong></em>',
Expand Down Expand Up @@ -827,6 +833,12 @@ public function allowed()
'',
'From specific cases',
],
'Kill script with newline entity' => [
'',
'<img src="java&NewLine;script:alert();" />',
'',
'From specific cases',
],
'Nested tags' => [
'',
'<em><strong>Fred</strong></em>',
Expand Down Expand Up @@ -1005,6 +1017,12 @@ public function allowImg()
'<img />',
'From generic cases',
],
'Kill script with newline entity' => [
'',
'<img src="java&NewLine;script:alert();" />',
'<img />',
'From generic cases',
],
'Nested tags' => [
'',
'<em><strong>Fred</strong></em>',
Expand Down Expand Up @@ -1206,6 +1224,12 @@ public function allowClass()
'',
'From specific cases',
],
'Kill script with newline entity' => [
'',
'<img src="java&NewLine;script:alert();" />',
'',
'From specific cases',
],
'Nested tags' => [
'',
'<em><strong>Fred</strong></em>',
Expand Down Expand Up @@ -1742,6 +1766,12 @@ public function blockedImg()
'',
'From specific cases',
],
'Kill script with newline entity' => [
'',
'<img src="java&NewLine;script:alert();" />',
'',
'From specific cases',
],
'Unquoted Attribute Without Space' => [
'',
'<img height=300>',
Expand Down
1 change: 1 addition & 0 deletions src/InputFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ class InputFilter
*/
private $blockedChars = [
'&tab;',
'&newline;',
'&space;',
'&colon;',
'&column;',
Expand Down