ecshop 关于 preg_replace /e 修饰符不安全的几处改动
来源:互联网 发布:简单快递单打印软件 编辑:程序博客网 时间:2024/04/29 03:25
主要集中在 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:
原语句:
$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);
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:
原语句:
$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);
0 0
- ecshop修饰符preg_replace/e不安全的几处改动
- ecshop修饰符preg_replace/e不安全的几处改动
- ecshop修饰符preg_replace/e不安全的几处改动
- ecshop 关于 preg_replace /e 修饰符不安全的几处改动
- ecshop在php5.5+报preg_replace/e错误的几处改动
- 慎用preg_replace危险的/e修饰符
- preg_replace的/e修饰符妙用与慎用
- php新版本废弃 preg_replace /e 修饰符
- preg_replace 修饰符 /e modifier is deprecated
- thinkphp php新版本废弃 preg_replace /e 修饰符
- preg_replace 修饰符
- 关于final修饰符的几点说明
- 安装ecshop 常见的 Strict Standards: array_shift()和Deprecated: preg_replace():
- ecshop中preg_replace替换为preg_replace_callback需要注意的事项
- 关于PHP的preg_replace的使用
- ECSHOP如何解决DEPRECATED: PREG_REPLACE()
- 关于preg_replace函数的问题讲解
- 关于 preg_match 以及preg_replace的问题。
- [济南考勤机专题]考勤机类型(六)生物识别考勤机
- 将扯淡的时间都用来做有意义的事
- 关于squid对同一个url缓存多个文件的资料记录
- 哮喘专题讨论会
- 通过ddms无法检查的内存泄漏如何查
- ecshop 关于 preg_replace /e 修饰符不安全的几处改动
- 3.14 MonoForAndroid用户人机界面--控制不同的文字字体
- 硬盘丢失了怎么才能恢复呢丨顶尖数据恢复软件恢复硬盘数据丨
- NGUI中的depth
- 在操作系统Centos 6.3 上使用Nexus 2.8搭建MAVEN私服 及 cloudstack 开发环境
- mysql 将时间戳直接转换成日期时间
- swift 易忽略的笔记 10):Generic
- 通用的Java hashCode重写方案
- 11gR2 RAC RMAN备份问题------手动删除归档日志导致RMAN-06059 ORA-19625