From ab6cdebb9196e19345aba1e58f9d2ef3690aa3a8 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 17 Dec 2015 11:58:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3templae=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/template.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/think/template.php b/library/think/template.php index 717bd5c9..0b9404c2 100644 --- a/library/think/template.php +++ b/library/think/template.php @@ -659,10 +659,10 @@ class Template //模板函数过滤 $fun = strtolower(trim($args[0])); switch ($fun) { - case 'default': // 特殊模板函数 + case 'default': // 特殊模板函数 $name = '(' . $name . ')?(' . $name . '):' . $args[1]; break; - default: // 通用模板函数 + default: // 通用模板函数 if (!in_array($fun, $template_deny_funs)) { if (isset($args[1])) { if (strstr($args[1], '###')) { @@ -775,7 +775,7 @@ class Template $parseStr = $this->parseTemplateName($tmplPublicName); // 替换变量 foreach ($vars as $key => $val) { - if (strpos($val, '[' . $key . ']')) { + if (strpos($parseStr, '[' . $key . ']')) { $parseStr = str_replace('[' . $key . ']', $val, $parseStr); } }