diff --git a/library/think/View.php b/library/think/View.php index 8ff888ab..31ccd22d 100644 --- a/library/think/View.php +++ b/library/think/View.php @@ -119,7 +119,7 @@ class View APP_HOOK && Hook::listen('view_filter', $content); // 允许用户自定义模板的字符串替换 if (!empty($this->replace)) { - $content = str_replace(array_keys($this->replace), array_values($this->replace), $content); + $content = strtr($content, $this->replace); } return $content; }