[ticket/13832] Use preg_replace_callback in acp_bbcodes

PHPBB3-13832
This commit is contained in:
Marc Alexander 2015-05-19 16:29:10 +02:00
parent 5796584611
commit a430fef05b

View file

@ -558,10 +558,18 @@ class acp_bbcodes
trigger_error($user->lang['BBCODE_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); trigger_error($user->lang['BBCODE_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
} }
$fp_match = preg_replace('#\[/?' . $bbcode_search . '#ie', "strtolower('\$0')", $fp_match); $fp_match = preg_replace_callback('#\[/?' . $bbcode_search . '#i', function ($match) {
$fp_replace = preg_replace('#\[/?' . $bbcode_search . '#ie', "strtolower('\$0')", $fp_replace); return strtolower($match[0]);
$sp_match = preg_replace('#\[/?' . $bbcode_search . '#ie', "strtolower('\$0')", $sp_match); }, $fp_match);
$sp_replace = preg_replace('#\[/?' . $bbcode_search . '#ie', "strtolower('\$0')", $sp_replace); $fp_replace = preg_replace_callback('#\[/?' . $bbcode_search . '#i', function ($match) {
return strtolower($match[0]);
}, $fp_replace);
$sp_match = preg_replace_callback('#\[/?' . $bbcode_search . '#i', function ($match) {
return strtolower($match[0]);
}, $sp_match);
$sp_replace = preg_replace_callback('#\[/?' . $bbcode_search . '#i', function ($match) {
return strtolower($match[0]);
}, $sp_replace);
return array( return array(
'bbcode_tag' => $bbcode_tag, 'bbcode_tag' => $bbcode_tag,