diff --git a/cake/libs/router.php b/cake/libs/router.php index 45b203515..77443b3cb 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -31,7 +31,7 @@ * */ if (!class_exists('Object')) { - uses('object'); + App::import('Core', 'Object'); } /** @@ -825,7 +825,10 @@ class Router extends Object { return $url; } if (empty($url)) { - return $path['here']; + if (!isset($path['here'])) { + $path['here'] = '/'; + } + $output = $base . $path['here']; } elseif (substr($url, 0, 1) == '/') { $output = $base . $url; } else { diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 6023e9036..58e21057a 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -52,6 +52,7 @@ class RouterTest extends UnitTestCase { function testFullBaseURL() { $this->assertPattern('/^http(s)?:\/\//', Router::url('/', true)); + $this->assertPattern('/^http(s)?:\/\//', Router::url(null, true)); } function testRouteWriting() {