mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
fix custom bbcode html replacement to correctly replace references
It failed if there was a number directly after the token, resulting in $12345, where $1 was needed. Fixed by using ${x} also made sure that newlines within the html replacement are not replaced with <br />. git-svn-id: file:///svn/phpbb/trunk@6391 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -290,7 +290,7 @@ 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('/(?<!\\\\)\$([0-9]+)/e', "'\${' . (\$1 + \$pad) . '}'", $replace);
|
||||
$pad = $repad;
|
||||
}
|
||||
|
||||
@@ -320,7 +320,7 @@ class acp_bbcodes
|
||||
$fp_replace = str_replace($token, $replace, $fp_replace);
|
||||
|
||||
$sp_match = str_replace(preg_quote($token, '!'), '(.*?)', $sp_match);
|
||||
$sp_replace = str_replace($token, '$' . ($n + 1), $sp_replace);
|
||||
$sp_replace = str_replace($token, '${' . ($n + 1) . '}', $sp_replace);
|
||||
}
|
||||
|
||||
$fp_match = '!' . $fp_match . '!' . $modifiers;
|
||||
|
Reference in New Issue
Block a user