商城首页出现这样的错误:
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in C:\websoft\web\hnxsjmy\shop\includes\cls_template.php on line 300
Strict Standards: Only variables should be passed by reference in C:\websoft\web\hnxsjmy\shop\includes\cls_template.php on line 418
解决:
return preg_replace("/{([^\}\{\n]*)}/e", "\$this->select('\\1');", $source);
// 替换成如下
return preg_replace_callback("/{([^\}\{\n]*)}/", function($r) {return $this->select($r[1]); }, $source);
只要 418 行把这一句拆成两句就没有问题了 $tag_sel = array_shift(explode(' ', $tag)); 改成:$tag_arr = explode(' ', $tag); $tag_sel = array_shift($tag_arr);
正文完
发表至: ECShop
2015-02-08