Skip to content

Commit 0e3ce1f

Browse files
committed
Merge pull request #7 from DiederikvandenB/master
Fixed bug #5.
2 parents 0b6c01e + 0bd4f51 commit 0e3ce1f

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/Frozennode/XssInput/Security.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ public static function xss_clean($str, $is_image = FALSE)
7878
$str = preg_replace_callback("/[a-z]+=([\'\"]).*?\\1/si", function($match){
7979
return str_replace(array('>', '<', '\\'), array('&gt;', '&lt;', '\\\\'), $match[0]);
8080
}, $str);
81-
$str = preg_replace_callback("/<\w+.*?(?=>|<|$)/si", function($match){
82-
return self::entity_decode($match[0], 'UTF-8');
83-
}, $str);
81+
$str = preg_replace_callback("/<\w+.*?(?=>|<|$)/si", 'self::entity_decode' , $str);
8482
/*
8583
* Remove Invisible Characters Again!
8684
*/
@@ -415,8 +413,9 @@ protected static function remove_evil_attributes($str, $is_image)
415413
* @param string
416414
* @return string
417415
*/
418-
protected static function entity_decode($str, $charset='UTF-8')
416+
protected static function entity_decode($arr, $charset='UTF-8')
419417
{
418+
$str = $arr[0];
420419
if (stristr($str, '&') === FALSE)
421420
{
422421
return $str;

0 commit comments

Comments
 (0)