Skip to content

Commit

Permalink
Merge pull request #33 from voku/analysis-zELdv9
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
voku committed Apr 17, 2018
2 parents 7debeae + 44b847e commit d8da4c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/voku/helper/AntiXSS.php
Original file line number Diff line number Diff line change
Expand Up @@ -2273,7 +2273,7 @@ private function _js_removal_callback(array $match, string $search): string

// hack for style attributes v1
if ($search === 'href') {
\preg_match("/style=\".*?\"/i", $match[0], $match_style);
\preg_match('/style=".*?"/i', $match[0], $match_style);
$match_style_matched = (\count($match_style) > 0);
if ($match_style_matched) {
$match[0] = \str_replace($match_style[0], 'voku::anti-xss::STYLE', $match[0]);
Expand Down
2 changes: 1 addition & 1 deletion tests/JsXssTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public function testFromJsXss()
// HTML5新增实体编码 冒号: 换行

self::assertSame('<a href="">', $this->security->xss_clean('<a href="javascript&colon;alert(/xss/)">'));
self::assertSame('<a href="">', $this->security->xss_clean('<a href="javascript&colonalert(/xss/)">'));
self::assertSame("<a href=\"a&NewLine;b\">", $this->security->xss_clean('<a href="a&NewLine;b">'));
self::assertSame('<a href="a&NewLine;b">', $this->security->xss_clean('<a href="a&NewLine;b">'));
self::assertSame('<a href="a&NewLineb">', $this->security->xss_clean('<a href="a&NewLineb">'));
self::assertSame('<a href="">', $this->security->xss_clean('<a href="javasc&NewLine;ript&colon;alert(1)">'));

Expand Down

0 comments on commit d8da4c9

Please sign in to comment.