diff --git a/cake/libs/http_socket.php b/cake/libs/http_socket.php index ba56034bd..1a486742c 100644 --- a/cake/libs/http_socket.php +++ b/cake/libs/http_socket.php @@ -539,7 +539,7 @@ class HttpSocket extends CakeSocket { if (!method_exists($authClass, 'authentication')) { throw new SocketException(sprintf(__('The %s do not support authentication.'), $authClass)); } - call_user_func("$authClass::authentication", $this, $this->_auth[$method]); + call_user_func_array("$authClass::authentication", array($this, &$this->_auth[$method])); } /** @@ -565,7 +565,7 @@ class HttpSocket extends CakeSocket { if (!method_exists($authClass, 'proxyAuthentication')) { throw new SocketException(sprintf(__('The %s do not support proxy authentication.'), $authClass)); } - call_user_func("$authClass::proxyAuthentication", $this, $this->_proxy); + call_user_func_array("$authClass::proxyAuthentication", array($this, &$this->_proxy)); } /** diff --git a/cake/libs/route/redirect_route.php b/cake/libs/route/redirect_route.php index e385dec0d..d9beaa42d 100644 --- a/cake/libs/route/redirect_route.php +++ b/cake/libs/route/redirect_route.php @@ -70,16 +70,15 @@ class RedirectRoute extends CakeRoute { } if (isset($this->options['persist']) && is_array($redirect)) { $argOptions['context'] = array('action' => $redirect['action'], 'controller' => $redirect['controller']); - $args = Router::getArgs($params['_args_'], $argOptions); - $redirect += $args['pass']; - $redirect += $args['named']; + $redirect += Router::getArgs($params['_args_'], $argOptions) + array('url' => array()); + $redirect = Router::reverse($redirect); } $status = 301; if (isset($this->options['status']) && ($this->options['status'] >= 300 && $this->options['status'] < 400)) { $status = $this->options['status']; } $this->response->header(array('Location' => Router::url($redirect, true))); - $this->response->statusCode($status); + $this->response->statusCode($status); $this->response->send(); } diff --git a/cake/tests/cases/libs/controller/controller.test.php b/cake/tests/cases/libs/controller/controller.test.php index 39563931b..91165cd22 100644 --- a/cake/tests/cases/libs/controller/controller.test.php +++ b/cake/tests/cases/libs/controller/controller.test.php @@ -1266,7 +1266,8 @@ class ControllerTest extends CakeTestCase { $Controller->passedArgs[] = '1'; $Controller->params['url'] = array(); $Controller->constructClasses(); - $this->assertEqual($Controller->paginate, array('page' => 1, 'limit' => 20)); + $expected = array('page' => 1, 'limit' => 20, 'maxLimit' => 100, 'paramType' => 'named'); + $this->assertEqual($Controller->paginate, $expected); $results = Set::extract($Controller->paginate('ControllerPost'), '{n}.ControllerPost.id'); $this->assertEqual($results, array(1, 2, 3)); diff --git a/cake/tests/cases/libs/view/helper.test.php b/cake/tests/cases/libs/view/helper.test.php index 4ef761091..9e57e3028 100644 --- a/cake/tests/cases/libs/view/helper.test.php +++ b/cake/tests/cases/libs/view/helper.test.php @@ -477,7 +477,7 @@ class HelperTest extends CakeTestCase { $result = $this->Helper->url('/controller/action/1?one=1&two=2'); $this->assertEqual($result, '/controller/action/1?one=1&two=2'); - $result = $this->Helper->url(array('controller' => 'posts', 'action' => 'index', 'page' => '1" onclick="alert(\'XSS\');"')); + $result = $this->Helper->url(array('controller' => 'posts', 'action' => 'index', ':page' => '1" onclick="alert(\'XSS\');"')); $this->assertEqual($result, "/posts/index/page:1" onclick="alert('XSS');""); $result = $this->Helper->url('/controller/action/1/param:this+one+more'); @@ -490,12 +490,12 @@ class HelperTest extends CakeTestCase { $this->assertEqual($result, '/controller/action/1/param:%7Baround%20here%7D%5Bthings%5D%5Bare%5D%24%24'); $result = $this->Helper->url(array( - 'controller' => 'posts', 'action' => 'index', 'param' => '%7Baround%20here%7D%5Bthings%5D%5Bare%5D%24%24' + 'controller' => 'posts', 'action' => 'index', ':param' => '%7Baround%20here%7D%5Bthings%5D%5Bare%5D%24%24' )); $this->assertEqual($result, "/posts/index/param:%7Baround%20here%7D%5Bthings%5D%5Bare%5D%24%24"); $result = $this->Helper->url(array( - 'controller' => 'posts', 'action' => 'index', 'page' => '1', + 'controller' => 'posts', 'action' => 'index', ':page' => '1', '?' => array('one' => 'value', 'two' => 'value', 'three' => 'purple') )); $this->assertEqual($result, "/posts/index/page:1?one=value&two=value&three=purple");