From e936d7dc7d14089bd41430cbee2dbec39ff26b2a Mon Sep 17 00:00:00 2001 From: thinkphp Date: Tue, 24 May 2016 17:02:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9BRoute=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 2 +- tests/thinkphp/library/think/routeTest.php | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/library/think/Route.php b/library/think/Route.php index 8d140f46..09c09ac5 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -645,7 +645,7 @@ class Route $key = array_shift($route); } - $key = $rule . ($key ? '/' . $key : ''); + $key = $rule . ($key ? '/' . ltrim($key, '/') : ''); // 检查规则路由 if (is_array($route)) { $option1 = $route[1]; diff --git a/tests/thinkphp/library/think/routeTest.php b/tests/thinkphp/library/think/routeTest.php index e3d3e20f..242b4a4a 100644 --- a/tests/thinkphp/library/think/routeTest.php +++ b/tests/thinkphp/library/think/routeTest.php @@ -166,11 +166,6 @@ class routeTest extends \PHPUnit_Framework_TestCase $this->assertEquals(['type' => 'method', 'method' => ['\app\index\controller\blog', 'read'], 'params' => []], Route::check($request, 'read')); } - public function testSsl() - { - $this->assertEquals(false, Route::isSsl()); - } - public function testDomain() { $_SERVER['HTTP_HOST'] = 'subdomain.thinkphp.cn';