preg replace - phpbb preg_replace deprecated error -


hi have moved php 5.6 , getting deprecated errors phpbb3 installation. offending line of code is:

$tpl = preg_replace('/{l_([a-z_]+)}/e', "(!empty(\$user->lang['\$1'])) ? \$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $tpl);

can advise on how convert preg_replace_callback?

i managed convert expression new format, , not php wizard, bit proud of it!
here have written remove error messages (bbcode.inc line 494):

$tpl = preg_replace_callback('/{l_([a-z0-9_]+)}/', function ($m) { return (!empty($user->lang['\$m[1]'])) ? $user->lang['\$m[1]'] : ucwords(strtolower(str_replace('_', ' ', '\$m[1]'))); }, $tpl); 

there similar line in bbcode.inc in line 370, can transformed in exact same manner, 1 in line 113, can't fix...

obviously because pattern comes variable, take little more figure 1 out.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -