Skip to content

Commit 0b6c01e

Browse files
committed
Merge pull request #4 from benjaminkohl/master
Made two of the regular expressions compatible with PHP 5.5+
2 parents 684cac2 + feb187d commit 0b6c01e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Frozennode/XssInput/Security.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,8 @@ protected static function entity_decode($str, $charset='UTF-8')
422422
return $str;
423423
}
424424
$str = html_entity_decode($str, ENT_COMPAT, $charset);
425-
$str = preg_replace('~&#x(0*[0-9a-f]{2,5})~ei', 'chr(hexdec("\\1"))', $str);
426-
return preg_replace('~&#([0-9]{2,4})~e', 'chr(\\1)', $str);
425+
$str = preg_replace_callback('~&#x(0*[0-9a-f]{2,5})~i', create_function('$matches', 'return chr(hexdec($matches[1]));'), $str);
426+
return preg_replace_callback('~&#([0-9]{2,4})~', create_function('$matches', 'return chr($matches[1]);'), $str);
427427
}//entity_decode
428428
/**
429429
* Filter Attributes

0 commit comments

Comments
 (0)