官网提示是这样的,对/e修饰符的支持已删除。请改用preg_replace_callback()
原因是/e 修正符使 preg_replace() 将 replacement 参数当作 PHP 代码(在适当的逆向引用替换完之后),会被一句话后门使用

看看smarty中是也是这样用的,也是存在问题
$source_content = preg_replace($search.'e', "'"
. $this->_quote_replace($this->left_delimiter) . 'php'
. "' . str_repeat(\"\n\", substr_count('\\0', \"\n\")) .'"
. $this->_quote_replace($this->right_delimiter)
. "'"
, $source_content);
可以把smarty模板修改成这个
$source_content = preg_replace_callback($search, function ($matches){
$str="";
$str.=$this->_quote_replace($this->left_delimiter) . 'php';
$str.=str_repeat("\\n\\", substr_count($matches[1], "\\n\\"));
$str.=$this->_quote_replace($this->right_delimiter);
return $str;
}, $source_content);

最新文章

  1. C#判断数组是否为空
  2. Django url()函数详解
  3. ORA-00245: control file backup failed; target is likely on a local file system
  4. win32_11gR2_database安装教程
  5. [AngularJS] Directive with Transcluded Elements
  6. MSSQL Server 导入/导出到远程服务器
  7. ibatis集成Sqlite:小数据库也有大作用
  8. vs 自动生成core dump文件
  9. SQL学习之高级联结(自联结、自然联结、外联接)
  10. Kotlin初探
  11. 算法题丨Longest Consecutive Sequence
  12. react-native-deprecated-custom-components
  13. Appium移动自动化测试入门及简单实例(python)
  14. XML部分
  15. apicloud 自定义模块引用aar
  16. js中表单数据序列化方式
  17. How to Pronounce the I in ING
  18. JavaScript周报#184
  19. Fiddler Web Session 列表(1)
  20. Eclipse开发Java程序入门,HelloWord

热门文章

  1. sqli-libs(11-22关)
  2. watch监听变化
  3. Java 使用代理发送Http请求 (将Http请求代理Https请求)
  4. PTA点赞狂魔
  5. PHPExcel 导出图片
  6. CentOS安装MySQL的步骤
  7. ASP.NET CORE 基础知识(一):概述【下】
  8. 【转载】MyEclipse6.5 KeyGen
  9. Top 9 colleges in the world from 2010 to 2020, AI and interdisciplinary areas.
  10. 计算机基础,Python - Map和Reduce