From 7b03d319b2be3510dc19b91976e5b1234dfde744 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Thu, 23 Jun 2016 19:08:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E6=A0=87=E7=AD=BE=E5=BA=93?= =?UTF-8?q?=E7=9A=84=E4=B8=8D=E5=8C=BA=E5=88=86=E5=A4=A7=E5=B0=8F=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/template/TagLib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/think/template/TagLib.php b/library/think/template/TagLib.php index 54e09da3..7e95c463 100644 --- a/library/think/template/TagLib.php +++ b/library/think/template/TagLib.php @@ -87,7 +87,7 @@ class TagLib public function parseTag(&$content, $lib = '') { $tags = []; - $_lib = $lib ? $lib . ':' : ''; + $_lib = $lib ? strtolower($lib) . ':' : ''; foreach ($this->tags as $name => $val) { $close = !isset($val['close']) || $val['close'] ? 1 : 0; $tags[$close][$_lib . $name] = $name; @@ -108,7 +108,7 @@ class TagLib $right = []; foreach ($matches as $match) { if ('' == $match[1][0]) { - $name = $match[2][0]; + $name = strtolower($match[2][0]); // 如果有没闭合的标签头则取出最后一个 if (!empty($right[$name])) { // $match[0][1]为标签结束符在模板中的位置 @@ -172,7 +172,7 @@ class TagLib $regex = $this->getRegex(array_keys($tags[0]), 0); $content = preg_replace_callback($regex, function ($matches) use (&$tags, &$_lib) { // 对应的标签名 - $name = $tags[0][$matches[1]]; + $name = $tags[0][strtolower($matches[1])]; $alias = $_lib . $name != $matches[1] ? ($_lib ? strstr($matches[1], $_lib) : $matches[1]) : ''; // 解析标签属性 $attrs = $this->parseAttr($matches[0], $name, $alias);