diff --git a/cake/libs/router.php b/cake/libs/router.php index e4c8e057f..414bc142d 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -871,7 +871,7 @@ class Router extends Object { if (!isset($path['here'])) { $path['here'] = '/'; } - $output = $base . $path['here']; + $output = $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 466179d52..12cd4af73 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -255,6 +255,21 @@ class RouterTest extends UnitTestCase { */ function testUrlGeneration() { extract(Router::getNamedExpressions()); + + Router::setRequestInfo(array( + array( + 'pass' => array(), 'action' => 'index', 'plugin' => null, 'controller' => 'subscribe', + 'admin' => true, 'url' => array('url' => '') + ), + array( + 'base' => '/magazine', 'here' => '/magazine', + 'webroot' => '/magazine/', 'passedArgs' => array('page' => 2), 'namedArgs' => array('page' => 2), + ) + )); + $result = Router::url(); + $this->assertEqual('/magazine', $result); + + Router::reload(); Router::connect('/', array('controller' => 'pages', 'action' => 'display', 'home')); $out = Router::url(array('controller' => 'pages', 'action' => 'display', 'home')); @@ -1281,7 +1296,7 @@ class RouterTest extends UnitTestCase { } /** * testParsingWithPrefixes method - * + * * @access public * @return void */ @@ -1313,7 +1328,7 @@ class RouterTest extends UnitTestCase { } /** * testPassedArgsOrder method - * + * * @access public * @return void */ @@ -1354,7 +1369,7 @@ class RouterTest extends UnitTestCase { } /** * testRegexRouteMatching method - * + * * @access public * @return void */