diff --git a/cake/libs/router.php b/cake/libs/router.php index 86e77daae..ed4f0eac6 100644 --- a/cake/libs/router.php +++ b/cake/libs/router.php @@ -1060,7 +1060,7 @@ class Router { * @access public * @static */ - function reverse($params) { + function reverse($params, $full = false) { $pass = $params['pass']; $named = $params['named']; $url = $params['url']; @@ -1072,7 +1072,7 @@ class Router { if (!empty($url)) { $params['?'] = $url; } - return Router::url($params); + return Router::url($params, $full); } /** diff --git a/cake/tests/cases/libs/router.test.php b/cake/tests/cases/libs/router.test.php index 0d199655d..a7b123c4f 100644 --- a/cake/tests/cases/libs/router.test.php +++ b/cake/tests/cases/libs/router.test.php @@ -2147,6 +2147,17 @@ class RouterTest extends CakeTestCase { ); $result = Router::reverse($params); $this->assertEqual($result, '/eng/posts/view/1?foo=bar&baz=quu'); + + $params = array( + 'lang' => 'eng', + 'controller' => 'posts', + 'action' => 'view', + 'pass' => array(1), + 'named' => array(), + 'url' => array('url' => 'eng/posts/view/1') + ); + $result = Router::reverse($params, true); + $this->assertPattern('/^http(s)?:\/\//', $result); } }