From a223dd5affba09a89ea8a6d9c1484363c85748b3 Mon Sep 17 00:00:00 2001 From: thinkphp Date: Fri, 9 Dec 2016 15:29:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BView=E7=B1=BB=E7=9A=84root?= =?UTF-8?q?=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/View.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/View.php b/library/think/View.php index 6a96b740..b724ba91 100644 --- a/library/think/View.php +++ b/library/think/View.php @@ -40,9 +40,9 @@ class View // 基础替换字符串 $request = Request::instance(); $base = $request->root(); - $root = strpos($base, '.') ? ltrim(dirname($base), '\\') : $base; + $root = strpos($base, '.') ? ltrim(dirname($base), DS) : $base; if ('' != $root) { - $root = '/' . $root; + $root = '/' . ltrim($root, '/'); } $baseReplace = [ '__ROOT__' => $root,