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';