1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/13832] Use preg_replace_callback instead of /e modifier

PHPBB3-13832
This commit is contained in:
Marc Alexander
2015-05-18 17:07:02 +02:00
parent c967ba7b9b
commit 71f5c9c327
2 changed files with 23 additions and 3 deletions

View File

@@ -491,7 +491,9 @@ class acp_bbcodes
if (preg_match_all('/(?<!\\\\)\$([0-9]+)/', $replace, $repad))
{
$repad = $pad + sizeof(array_unique($repad[0]));
$replace = preg_replace('/(?<!\\\\)\$([0-9]+)/e', "'\${' . (\$1 + \$pad) . '}'", $replace);
$replace = preg_replace_callback('/(?<!\\\\)\$([0-9]+)/', function ($match) use ($pad) {
return '${' . ($match[1] + $pad) . '}';
}, $replace);
$pad = $repad;
}