主要集中在 upload/includes/cls_template.php 文件中:
1:line 300 :
原語句:
return preg_replace("/{([^\}\{\n]*)}/e", "\$this->select('\\1');", $source);
修改為:
return preg_replace_callback("/{([^\}\{\n]*)}/", function($r) { return $this->select($r[1]); }, $source);
2:line 495:
原語句:
$out = "<?php \n" . '$k = ' . preg_replace("/(\'\\$[^,]+)/e" , "stripslashes(trim('\\1','\''));", var_export($t, true)) . ";\n";
修改為:
$replacement = preg_replace_callback("/(\'\\$[^,]+)/" ,
function($matcher){
return stripslashes(trim($matcher[1],'\''));
},
var_export($t, true));
$out = "<?php \n" . '$k = ' . $replacement . ";\n";
3:line 554:
原語句:
$val = preg_replace("/\[([^\[\]]*)\]/eis", "'.'.str_replace('$','\$','\\1')", $val);
修改為:
$val = preg_replace_callback("/\[([^\[\]]*)\]/is",
function ($matcher) {
return '.'.str_replace('$','\$',$matcher[1]);
},
$val);
4:line 1071:
/* 將模板中所有l(wèi)ibrary替換為鏈接 */
原 //$pattern = '/<!--\s#BeginLibraryItem\s\"\/(.*?)\"\s-->.*?<!--\s#EndLibraryItem\s-->/se';
$pattern = '/<!--\s#BeginLibraryItem\s\"\/(.*?)\"\s-->.*?<!--\s#EndLibraryItem\s-->/s';
$replacement = "'{include file='.strtolower('\\1'). '}'";
原 //$source = preg_replace($pattern, $replacement, $source);
$source = preg_replace_callback($pattern, function($ro){return '{include file='.strtolower($ro[1]). '}';}, $source);
二、后臺錯(cuò)誤
ECShop安裝之后膳音,在后臺發(fā)現(xiàn)一個(gè)錯(cuò)誤提示:
Strict Standards: mktime(): You should be using the time() function instead in E:\web\shopex\admin\shop_config.php on line 32
這個(gè)錯(cuò)誤提示的意思:mktime()方法不帶參數(shù)被調(diào)用時(shí)铃诬,會被拋出一個(gè)報(bào)錯(cuò)提示苍凛。
找到文件第32行:
$auth = mktime();
將mktime()替換成time()方法兵志,代碼為:
$auth = time();