From 1802e641a9beb4129569e5e01a9ef1173cf50f93 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sun, 27 Dec 2015 15:14:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=A4=9A=E4=BD=99=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/template.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/library/think/template.php b/library/think/template.php index 06da38e4..b401d0f9 100644 --- a/library/think/template.php +++ b/library/think/template.php @@ -697,12 +697,7 @@ class Template // 所有以Think.打头的以特殊变量对待 无需模板赋值就可以输出 $parseStr = $this->parseThinkVar($vars); } else { - // 一维自动识别对象和数组 - if (is_array($first)) { - $parseStr = $first . '[\'' . implode('\'][\'', $vars) . '\']'; - } else { - $parseStr = $first . '->' . implode('->', $vars); - } + // 自动识别对象和数组 $parseStr = 'is_array(' . $first . ')?' . $first . '[\'' . implode('\'][\'', $vars) . '\']:' . $first . '->' . implode('->', $vars); } } else {