From 386e7ab8d3c60bf1448b9c751eaff6ce60e91f18 Mon Sep 17 00:00:00 2001 From: oldrind <1401019000@qq.com> Date: Fri, 18 Mar 2016 11:48:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dphp=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E6=97=B6=E8=BE=93=E5=87=BA=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E9=97=B4=E7=9A=84=E7=A9=BA=E6=A0=BC=E4=B9=9F=E8=A2=AB=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/think/Template.php b/library/think/Template.php index 10d14142..db79043a 100644 --- a/library/think/Template.php +++ b/library/think/Template.php @@ -332,7 +332,7 @@ class Template $content = preg_replace($find, $replace, $content); } // 优化生成的php代码 - $content = preg_replace('/\?>\s*<\?php\s?/is', '', $content); + $content = preg_replace('/\?>\s*<\?php\s(?!echo\b)/s', '', $content); // 模板过滤输出 $replace = $this->config['tpl_replace_string']; $content = str_replace(array_keys($replace), array_values($replace), $content);