Ecshop如何解决Deprecated: preg_replace()报错 (第二章)

这些错误主要集中在 upload/includes/cls_template.php 文件中:
1:line 300 :
原语句:
return preg_replace("/{([^}{\n]*)}/e", “$this->select(’\1’);”, KaTeX parse error: Expected '}', got '\n' at position 58: …back("/{([^\}\{\̲n̲]*)}/", functio…r) { return t h i s − > s e l e c t ( this->select( this>select(r[1]); }, $source);

2:line 495:
原语句:
KaTeX parse error: Expected 'EOF', got '\n' at position 14: out = "k = ’ . preg_replace("/(’\KaTeX parse error: Can't use function '\'' in math mode at position 39: …es(trim('\\1','\̲'̲'));", var_expo…t, true)) . “;\n”;
修改为:
$replacement = preg_replace_callback("/(’\ [ , ] + ) / " , f u n c t i o n ( [^,]+)/" , function( [,]+)/",function(matcher){ return stripslashes(trim(KaTeX parse error: Can't use function '\'' in math mode at position 13: matcher[1],'\̲'̲')); },var_exp…t, true));
KaTeX parse error: Expected 'EOF', got '\n' at position 14: out = "k = ’ . $replacement . “;\n”;

3:line 554:
原语句:
KaTeX parse error: Expected 'EOF', got '\[' at position 22: …preg_replace("/\̲[̲([^\[\]]*)\]/ei…‘,’$’,’\1’)", $val);
修改为:
KaTeX parse error: Expected 'EOF', got '\[' at position 31: …ace_callback("/\̲[̲([^\[\]]*)\]/is…matcher) { return ‘.’.str_replace(’$’,’$’,$matcher[1]); }, $val);

4 商品批量上传出现
Assigning the return value of new by reference is deprecated in admin\goods_batch.php on line 921
$filter = &new stdclass;
改成
$filter = new stdclass;

5.后台商店设置出现 You should be using the time() function instead in admin\sms_url.php on line 31
admin\shop_config.php on line 32
mktime() 修改为 time()

6.数据库备份出现 edefining already defined constructor for class cls_sql_dump

\admin\includes\cls_sql_dump.php on line 90
function __construct(&$db, $max_size =0)
{
t h i s − > c l s s q l d u m p ( this->cls_sql_dump( this>clssqldump(db, KaTeX parse error: Expected 'EOF', got '}' at position 16: max_size); }̲ 移到function cls…db, KaTeX parse error: Expected 'EOF', got '\database' at position 70: …om_name() admin\̲d̲a̲t̲a̲b̲a̲s̲e̲.php on line 64…username="")
修改成
function set_cookie ($username="", KaTeX parse error: Expected 'EOF', got '\modules' at position 26: … NULL) includes\̲m̲o̲d̲u̲l̲e̲s̲\integrates\php…username, $password, $email, $gender = -1, $bday = 0, $reg_date = 0, m d 5 p a s s w o r d = ′ ′ ) 127 行 修 改 成 f u n c t i o n l o g i n ( md5password = '') 127行修改成 function login( md5password=)127functionlogin(username, $password, $remember = NULL)
8. Strict Standards: Only variables should be passed by reference in E:\web\shopex\includes\cls_template.php on line 422
$tag_sel = array_shift(explode(’ ‘, $tag));
改成:
$tag_arr = explode(’ ', $tag); t a g s e l = a r r a y s h i f t ( tag_sel = array_shift( tagsel=arrayshift(tag_arr);

  1. ecshop的时候出现如下错误Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in \ecshop\includes\cls_template.php on line 300

打开ecshop的目录找到includes\cls_template.php 到第300行

把 return preg_replace("/{([^}{\n])}/e", “$this->select(’\1’);”, KaTeX parse error: Expected '}', got '\n' at position 53: …back("/{([^\}\{\̲n̲]*)}/", functio…r) { return t h i s − > s e l e c t ( this->select( this>select(r[1]); }, $source);
10.ecshop提示Strict Standards: Non-static method cls_image::gd_version() should not be called statically inE:\wwwroot\weirenchou\includes\lib_base.php on line 346找到346行吧
return cls_image::gd_version()
替换成:
$p = new cls_image();
return KaTeX parse error: Expected 'EOF', got '\Program' at position 113: … callback in E:\̲P̲r̲o̲g̲r̲a̲m̲ ̲Files\xampps\ht…pattern = '/ .
? /s’;
// r e p l a c e m e n t = " ′ i n c l u d e f i l e = ′ . s t r t o l o w e r ( ′ 1 ′ ) . ′ ′ " ; / / replacement = "'{include file='.strtolower('\\1'). '}'"; // replacement="includefile=.strtolower(1).";//source = preg_replace($pattern, $replacement, $source);
s o u r c e = p r e g r e p l a c e c a l l b a c k ( source = preg_replace_callback( source=pregreplacecallback(pattern,
function (KaTeX parse error: Expected '}', got 'EOF' at end of input: …e='.strtolower(matcher[1]).’}’;
},$source);

你可能感兴趣的:(源码报错锦集,Ecshop)