diff options
author | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2015-06-24 16:36:15 +0200 |
---|---|---|
committer | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2015-06-24 16:36:15 +0200 |
commit | 6bcf12a558bed49267aba12b6ef000c52e8632e2 (patch) | |
tree | 98a791e859b40d3ede55e335a1da68417fe7cbfc /phpBB/develop | |
parent | d430acb5680ddfd249daf1bd41a268ed47a6823e (diff) | |
parent | c30e0610e938b40a8c04463d2b8de5a64ee59210 (diff) | |
download | forums-6bcf12a558bed49267aba12b6ef000c52e8632e2.tar forums-6bcf12a558bed49267aba12b6ef000c52e8632e2.tar.gz forums-6bcf12a558bed49267aba12b6ef000c52e8632e2.tar.bz2 forums-6bcf12a558bed49267aba12b6ef000c52e8632e2.tar.xz forums-6bcf12a558bed49267aba12b6ef000c52e8632e2.zip |
Merge pull request #3618 from marc1706/ticket/13832
[ticket/13832] Use preg_replace_callback instead of /e modifier
Diffstat (limited to 'phpBB/develop')
-rw-r--r-- | phpBB/develop/check_flash_bbcodes.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/phpBB/develop/check_flash_bbcodes.php b/phpBB/develop/check_flash_bbcodes.php index 6e1b415bb6..5dc112bfc0 100644 --- a/phpBB/develop/check_flash_bbcodes.php +++ b/phpBB/develop/check_flash_bbcodes.php @@ -140,8 +140,12 @@ function html_entity_decode_utf8($string) static $trans_tbl; // replace numeric entities - $string = preg_replace('~&#x([0-9a-f]+);~ei', 'code2utf8(hexdec("\\1"))', $string); - $string = preg_replace('~&#([0-9]+);~e', 'code2utf8(\\1)', $string); + $string = preg_replace_callback('~&#x([0-9a-f]+);~i', function ($match) { + return code2utf8(hexdec($match[1])); + }, $string); + $string = preg_replace_callback('~&#([0-9]+);~', function ($match) { + return code2utf8($match[1]); + }, $string); // replace literal entities if (!isset($trans_tbl)) |