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;