现在的位置: 首页 > 综合 > 正文

ThinkPHP3.2 新bug ReadHtmlCache 支持不区分大小写的函数

2016年07月23日 ⁄ 综合 ⁄ 共 349字 ⁄ 字号 评论关闭

报错提示:

Fatal error: Function name must be a string in D:\wwwroot\zbphp.com\ThinkPHP\Library\Behavior\ReadHtmlCacheBehavior.class.php on line
87

代码如下:

// {|FUN} 单独使用函数
$rule  = preg_replace_callback('/{|(\w+)}/', function($match){return $match[1]();},$rule);

解决方法:支持大小写不区分的函数

// {|FUN} 单独使用函数
$rule  = preg_replace_callback('/{|(\w+)}/i', function($match){return $match[1]();},$rule);

抱歉!评论已关闭.