ecshop安装时应改的错误

本文介绍了解决PHP中因使用过时的正则表达式语法而导致的警告信息的方法。通过更新preg_replace调用为preg_replace_callback,并修复了其他一些代码问题。

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in C:\xampp\htdocs\ec\upload\includes\cls_template.php on line 493

return preg_replace_callback("/{([^\}\{\n]*)}/", function($r) { return $this->select($r[1]); }, $source);

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in C:\xampp\htdocs\ec\upload\includes\cls_template.php on line 1073

       $pattern     = '/<!--\s#BeginLibraryItem\s\"\/(.*?)\"\s-->.*?<!--\s#EndLibraryItem\s-->/s';
            $replacement = function ($r) { return '{include file='.strtolower($r[1]). '}'; };
            $source      = preg_replace_callback($pattern, $replacement, $source);

 cls_template.php的300行

return preg_replace_callback("/{([^\}\{\n]*)}/", function($r) { return $this->select($r[1]); }, $source); 

将cls_template.php的493行

$out = <?php \n" . '$k = ' . preg_replace_callback("/(\'\\$[^,]+)/" , function($r) {return stripslashes(trim($r[1],'\''));}, var_export($t, true)) . ";\n";

将cls_template.php的552行

$val = preg_replace_callback("/\[([^\[\]]*)\]/", function($r) {return '.'.str_replace('$','$',$r[1]);}, $val);

将cls_template.php的422行

            $tag_val = explode(' ', $tag);
            $tag_sel = array_shift($tag_val);

 lib_base.php345行

 return cls_image::gd_version();然后在找到include/cls_image.php中的678行,发现gd_version()方 法未声明静态static,所以会出错。这时候只要:   1)将function gd_version()改成static function gd_version()即可。

 

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in C:\xampp\htdocs\ec\upload\includes\cls_template.php on line 554

$val = preg_replace_callback("/\[([^\[\]]*)\]/is", function($r) { return '.'.$r[1]; }, $val);

Strict Standards: mktime(): You should be using the time() function instead in C:\xampp\htdocs\ec\upload\admin\sms_url.php on line 31

Strict Standards: mktime(): You should be using the time() function instead in C:\xampp\htdocs\ec\upload\admin\shop_config.php on line 32

    $auth = time();

 

转载于:https://www.cnblogs.com/xujing6/p/6829552.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值