From 01bb82c04c9a534280c6724d6cde34f54872fdd0 Mon Sep 17 00:00:00 2001 From: shirne Date: Sat, 24 Apr 2021 10:20:56 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=A8=A1=E6=9D=BFinclude=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=8F=98=E9=87=8F=E5=92=8C=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E4=BC=A0=E9=80=92=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Template.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/Template.php b/library/think/Template.php index 2855cbcb26..91b29caad6 100644 --- a/library/think/Template.php +++ b/library/think/Template.php @@ -541,8 +541,8 @@ private function parseInclude(&$content) foreach ($array as $k => $v) { // 以$开头字符串转换成模板变量 - if (0 === strpos($v, '$')) { - $v = $this->get(substr($v, 1)); + if (0 === strpos($v, '$') || 0 === strpos($v, ':')) { + $v = '{' . $v . '}'; } $parseStr = str_replace('[' . $k . ']', $v, $parseStr); From 354fcb182c2e093d0668a412d9e6e9b5e88815ee Mon Sep 17 00:00:00 2001 From: shirne Date: Sat, 24 Apr 2021 12:54:03 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B6=88=E9=99=A4styleci=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Template.php | 1 + 1 file changed, 1 insertion(+) diff --git a/library/think/Template.php b/library/think/Template.php index 91b29caad6..976d255c25 100644 --- a/library/think/Template.php +++ b/library/think/Template.php @@ -1290,6 +1290,7 @@ private function getRegex($tagName) break; case 'include': $name = 'file'; + // no break case 'taglib': case 'layout': case 'extend':