Wykonałem aktualizację Debiana z 7.8 do 8.1. Przy okazji PHP poszło do 5.6.9-0+deb8u1. Mam na nim LMSa. Dostaję teraz błędy w stylu:
Cytat
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /var/www/lms/lib/common.php
Przykładowe fragmenty kodu sprawiające problemy:
function docnumber($number=NULL, $template=NULL, $time=NULL, $ext_num='')
{
<------>$number = $number ? $number : 1;
<------>$template = $template ? $template : DEFAULT_NUMBER_TEMPLATE;
<------>$time = $time ?
$time : time(); <------>
<------>// extended number part
<------>$result = str_replace('%I', $ext_num, $template);
<------>// main document number
[b
]<------>$result = preg_replace('/%(\\d*)N/e', "sprintf('%0\\1d', $number)", $result);[/b
] <------>
<------>// time conversion specifiers
<------>return strftime($result, $time); }
]
function smarty_modifier_striphtml($args)
{
$search = array ("'<script[^>]*?>.*?</script>'si", // Strip out javascript "'<[\/\!]*?[^<>]*?>'si", // Strip out html tags
"'([\r\n])[\s]+'", // Strip out white space
"'&(quot|#34);'i", // Replace html entities
"'&(amp|#38);'i",
"'&(lt|#60);'i",
"'&(gt|#62);'i",
"'&(nbsp|#160);'i",
"'&(iexcl|#161);'i",
"'&(cent|#162);'i",
"'&(pound|#163);'i",
"'&(copy|#169);'i",
[b]"'&#(\d+);'e"); // evaluate as php[/b]
"\\1",
"\"",
"&",
"<",
">",
" ",
chr(161),
chr(162),
chr(163),
chr(169),
"chr(\\1)");
}
Niestety moje umiejętności programowania w PHP są zbyt ubogie aby przerobić ten kod. Prosiłbym o pomoc