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. yii第二步

    yii第二步: main.php 'urlManager'=>array('urlFormat'=>'path','rules'=>array('game/guess/<g:\ ...

  2. 超短reads(primer、barcode、UMI、index等)比对方法

    二代reads最短都有50bp,所以大家常用的比对工具都是不支持50bp以下的reads的比对的. 但是,在实际中,我们确实又有比对super short reads的需求. So,我找到了如下方法来 ...

  3. 『Collections』Counter计数

    Counter()方法 计数器,返回字典,会同时去重,文本处理常用 from collections import Counter co = Counter(list('abcdefgad')) co ...

  4. install rabbitvcs in ubuntu16.04

    reference: https://github.com/rabbitvcs/rabbitvcs how to install : sudo apt-get install rabbitvcs-cl ...

  5. [转载]彻底卸载oracleXE数据库服务器

    URL:http://www.2cto.com/database/201306/216182.html

  6. [转载]java中io流关闭的顺序

    原文URL:http://blog.csdn.net/shijinupc/article/details/7191655 还是先看API void close()            Closes ...

  7. NETGEAR WNDR3800CH openwrt 不能用新版, Barrier Breaker 14.07

    15系列主要是不能正常端口映射,这个很不方便了. 尽管80端口被封了,我们可以用别的端口啊. 刷完以后,不懂英文的,跟着下面的步骤就可以进入中文环境了. 记得先上网,再通过路由下载安装中文包,才可以. ...

  8. C语言define 可以提高程序运行的速度

    define的优缺点 优点 提高了程序的可读性,同时也方便进行修改: 提高程序的运行效率:使用带参的宏定义既可完成函数调用的功能,又能避免函数的出栈与入栈操作,减少系统开销,提高运行效率: 3.宏是由 ...

  9. Nutch相关视频教程3

    参考: http://www.cnblogs.com/huligong1234/p/3515214.html

  10. 一个在windows电脑上控制比较全的文件夹的设置方式

    一个在windows电脑上控制比较全的文件夹的设置方式: 1.在桌面上创建一个新建文件夹 2.将新建文件夹重命名为  万能控制模式.{ED7BA470-8E54-465E-825C-99712043E ...