当前位置 : 主页 > 网络编程 > PHP >

ecshop如何解决includes\cls_template.php on line 418错误

来源:互联网 收集:自由互联 发布时间:2021-06-28
ecshop如何解决includes\cls_template.php on line 418错误 有客户在安装ECSHOP系统后,打开网站遇到\includes\cls_template.php on line 418报错的问题,现在ECSHOP网站开发中心官方技术就把相应的解决方法整
ecshop如何解决includes\cls_template.php on line 418错误
有客户在安装ECSHOP系统后,打开网站遇到\includes\cls_template.php on line 418报错的问题,现在ECSHOP网站开发中心官方技术就把相应的解决方法整理分享出来给大家看下,报错所示:Strict Standards: Only variables should be passed by reference in upload\includes\cls_template.php on line 418
 
第418行:$tag_sel = array_shift(explode(' ', $tag));
 
解决办法 1:
 
5.3以上版本的问题,应该也和配置有关 只要418行把这一句拆成两句就没有问题了 $tag_sel = array_shift(explode(' ', $tag));
 
改成: $tag_arr = explode(' ', $tag); $tag_sel = array_shift($tag_arr);
 
(实验过,绝对可行) 因为array_shift的参数是引用传递的,5.3以上默认只能传递具体的变量,而不能通过函数返回值,同理举一反三:遇到函数嵌套错误时可以分开写,错误自然解决
 
function get_dyna_libs($theme, $tmp)
{
$extsub = explode('.', $tmp);
$ext = end($extsub);
$tmp = basename($tmp,".$ext");
$sql = 'SELECT region, library, sort_order, id, number, type' .
' FROM ' . $GLOBALS['ecs']->table('template') .
" WHERE theme = '$theme' AND filename = '" . $tmp . "' AND type > 0 AND remarks=''".
' ORDER BY region, library, sort_order';
$res = $GLOBALS['db']->getAll($sql);
$dyna_libs = array();
foreach ($res AS $row)
{
$dyna_libs[$row['region']][$row['library']][] = array(
'id' => $row['id'],
'number' => $row['number'],
'type' => $row['type']
);
}
return $dyna_libs;
}
 
将 $ext = end(explode('.', $tmp));
 
改为
 
$extsub = explode('.', $tmp);
$ext = end($extsub);
 
解决办法 2(屏蔽错误) :
 
或则如果这样配置的话: error_reporting = E_ALL | E_STRICT   php.ini中有如下设置:error_reporting = E_ALL | E_STRICT
 
这是说,显示那些不符合编码规范的警告(coding standards warnings)。Joomla其实是建议取消error的输出,如果出于调试需要,应改为 error_reporting = E_ALL & ~E_NOTICE
网友评论