From 1f4cb837f050c94fc41ae747a3c47bc17034492a Mon Sep 17 00:00:00 2001 From: Moobusy Date: Mon, 23 May 2016 18:46:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=B7=AF=E7=94=B1=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=8C=BA=E5=88=86=20hello=20=E5=92=8C=20=20hello/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正路由无法区分 hello 和 hello/,这应该是两个地址,一个是文件,一个是路径 --- library/think/Request.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/think/Request.php b/library/think/Request.php index ef9ba1f2..6e032c21 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -324,7 +324,7 @@ class Request } } } - $this->pathinfo = empty($_SERVER['PATH_INFO']) ? '/' : trim($_SERVER['PATH_INFO'], '/'); + $this->pathinfo = empty($_SERVER['PATH_INFO']) ? '/' : ltrim($_SERVER['PATH_INFO'], '/'); } return $this->pathinfo; }