ecshop修饰符preg_replace/e不安全的几处改动

Strict standards: Only variables should be passed by reference in D:\wamp64\www\includes\lib_main.php on line 1329

主要集中在 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: //zuimoban.com  转载不带网址,木JJ

原语句:

$val = preg_replace("/\[([^\[\]]*)\]/eis", "'.'.str_replace('$','\$','\\1')", $val);

修改为:

$val = preg_replace_callback("/\[([^\[\]]*)\]/is",

function ($matcher) {

return '.'.str_replace('$','\$',$matcher[1]);

},

$val);

4:line 1071:

原语句:

$replacement = "'{include file='.strtolower('\\1'). '}'";

$source      = preg_replace($pattern, $replacement, $source);

修改为:

$source      = preg_replace_callback($pattern,

function ($matcher) {

return '{include file=' . strtolower($matcher[1]). '}';

},

$source);

5:line 419:

原语句:

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

修改为:

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

$tag_sel = array_shift($tag_val);

在upload/includes/lib_main.php 文件中

1:line  1329:

原始语句:

$ext = end(explode('.', $tmp));

修改为:

$tmp_val = explode('.', $tmp);

$ext = end($tmp_val);

修改完后记得在后台中点击清除缓存进行生效。

当php版本为5.6时的提示信息解决方法的更多相关文章

  1. Android Studio2.x版本无法自动关联源码的解决方法

    Android Studio2.x版本无法自动关联源码的解决方法 在学习android开发过程中,对于一个不熟悉的类,阅读源码是一个很好的学习方式,使用andorid studio开发工具的SDK M ...

  2. npm install安装时忘记--save解决方法

    title: npm install安装时忘记--save解决方法 date: 2017-05-07 20:17:54 tags: npm categories: --- 网上还有一个解决方案就是: ...

  3. Linux使用退格键时出现^H ^?解决方法

    Linux使用退格键时出现^H ^?解决方法 在linux下执行脚本不注意输错内容需要删除时总是出现^H ^H不是H键的意思,是backspace.主要是当你的终端backspace有问题的时候才需要 ...

  4. yum安装命令:遇到的问题报错如下: File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: 通过看报错可以了解到是使用了python2的语法,所以了解到当前yum使用的Python2,因为我单独安装了python3,且python3设置为默认版本了,所以导致语法问题 解决方法: 使用python2.6 yum install

    1.安装zip yum install -y unzip zip 2.安装lrszs yum -y install lrzsz 3.安装scp 遇到下面的问题: 结果提示: No package sc ...

  5. Linux时间变慢解决方法

    情景:系统为CentOS-5.4,硬件时间正确(查看硬件时间的方法见下面),系统时间每隔24小时会慢20分钟左右Linux将时钟分为系统时钟(System Clock)和硬件(Real Time Cl ...

  6. [转] linux下shell中使用上下键翻出历史命名时出现^[[A^[[A^[[A^[[B^[[B的问题解决,Linux使用退格键时出现^H解决方法

    [From] https://www.zmrbk.com/post-2030.html https://blog.csdn.net/suifengshiyu/article/details/40952 ...

  7. CMake配置VTK时Qt5_DIR-NOTFOUND的解决方法

    直接给解决方法了,不废话. Qt5的路径,请参考:C:\Program\IDE\Qt\Qt5.13.0\5.13.0\msvc2017_64\lib\cmake\Qt5 参考文章 CMake配置VTK ...

  8. python使用退格键时出现^H解决方法

    Linux 使用退格键时出现^H解决方法 1.临时解决 按ctrl 2.永久解决 基本现象 进入 Python shell,按下 Delete/Backspace 键: Python 3.5.2 (d ...

  9. sql 关于查询时 出现的 从数据类型 varchar 转换为 numeric 时出错 的解决方法。

    出现这种问题 一般是查询时出现了 varchar 转 numeric 时出了错  或varchar字段运算造成的 解决方法: 让不能转的数不转换就可以了 sql的函数有个isNumeric(参数) 用 ...

随机推荐

  1. 快速搭建一个简易的KMS 服务

    xu言: 之前,闹的沸沸扬扬的KMS激活工具自身都存在问题的事.让我们对以前的什么小马激活.kms激活.各种激活工具都去打了一个深深的“?”,到底哪些能用.哪些不能用.有些还注明的里面必须要关闭杀毒软 ...

  2. ssh The authenticity of host '10.11.26.2 (10.11.26.2)' can't be established

    The authenticity of host '10.11.26.2 (10.11.26.2)' can't be established. ECDSA key fingerprint is SH ...

  3. git 添加tag

    前言 什么是tag?tag是节点的意思,一般在上线的时候使用.比如说:你在本地做了好几个功能,然后把这些功能提交到了上线的分支上,某个时刻,你想上线你的新功能,这个时候你需要你个tag来标记一下,告诉 ...

  4. 使用poi导出Excel,并设定单元格内容类型,抛出异常

    本例子使用的是HSSF,为Excel2003提供处理方案. 设定为输入类型为数值 import org.apache.poi.hssf.usermodel.DVConstraint; import o ...

  5. 一篇分析诊断被&quot;hang&quot;住数据库的资料(Oracle Performance Diagnostic Guide——Hang/Locking)

    该资料已上传至本人QQ群空间,如需该资料,可到本人QQ群空间查找.下面贴表文本: Oracle Performance Diagnostic GuideHang/LockingVersion 3.1. ...

  6. Centos7上部署openstack mitaka配置详解(将疑难点都进行划分)

    在配置openstack项目时很多人认为到处是坑,特别是新手,一旦进坑没有人指导,身体将会感觉一次次被掏空,作为菜鸟的我也感同身受,因为已经被掏空n次了. 以下也是我将整个openstack配置过程进 ...

  7. 关于PermGen space内存溢出错误解决方法

    1.参考: http://blog.csdn.net/fox009/article/details/5633007 http://hi.baidu.com/like_dark/blog/item/19 ...

  8. oracle增加表空间

    select tablespace_name, sum(bytes)/1024/1024 from dba_data_files group by tablespace_name; select ta ...

  9. 对va_list; va_start ; va_end ;vsprintf理解(转)

    以下为转载内容: int printf(const char* fmt, ...) { va_list args; int i; //1.将变参转化为字符串 va_start(args,fmt); v ...

  10. substr和substring,slice和splice的区别,js字符串截取和数组截取

    本文参考了文章:https://blog.csdn.net/kenberkeley/article/details/50983734 博主已经总结得很好了,看完之后也能明白,不过还是觉得要自己动手敲一 ...