From 00517f912570e1708f5a8e884114c1fbdd3f29ac Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 14 Jun 2016 15:33:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3Request=E7=B1=BB=E7=9A=84crea?= =?UTF-8?q?te=E6=96=B9=E6=B3=95=20=E4=BF=AE=E6=AD=A3Route=E7=B1=BB?= =?UTF-8?q?=E7=9A=84check=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Request.php | 2 +- library/think/Route.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/think/Request.php b/library/think/Request.php index e0648f12..3e1a3940 100644 --- a/library/think/Request.php +++ b/library/think/Request.php @@ -194,7 +194,7 @@ class Request $options['server'] = $server; $options['url'] = $server['REQUEST_URI']; $options['baseUrl'] = $info['path']; - $options['pathinfo'] = $info['path']; + $options['pathinfo'] = ltrim($info['path'],'/'); $options['method'] = $server['REQUEST_METHOD']; $options['domain'] = $server['HTTP_HOST']; self::$instance = new self($options); diff --git a/library/think/Route.php b/library/think/Route.php index 96cb3640..56f5cef4 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -695,7 +695,7 @@ class Route if (!empty($val['routes'])) { // 分组路由 - if ($pos = strpos($rule, ':') || $pos = strpos($rule, '<')) { + if (($pos = strpos($rule, ':')) || ($pos = strpos($rule, '<'))) { $str = substr($rule, 0, $pos); } else { $str = $rule;