Skip to content

Commit

Permalink
Merge pull request #4 from benjaminkohl/master
Browse files Browse the repository at this point in the history
Made two of the regular expressions compatible with PHP 5.5+
  • Loading branch information
janhartigan committed Jan 29, 2014
2 parents 684cac2 + feb187d commit 0b6c01e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Frozennode/XssInput/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,8 @@ protected static function entity_decode($str, $charset='UTF-8')
return $str;
}
$str = html_entity_decode($str, ENT_COMPAT, $charset);
$str = preg_replace('~&#x(0*[0-9a-f]{2,5})~ei', 'chr(hexdec("\\1"))', $str);
return preg_replace('~&#([0-9]{2,4})~e', 'chr(\\1)', $str);
$str = preg_replace_callback('~&#x(0*[0-9a-f]{2,5})~i', create_function('$matches', 'return chr(hexdec($matches[1]));'), $str);
return preg_replace_callback('~&#([0-9]{2,4})~', create_function('$matches', 'return chr($matches[1]);'), $str);
}//entity_decode
/**
* Filter Attributes
Expand Down

0 comments on commit 0b6c01e

Please sign in to comment.