Skip to content

Commit

Permalink
Fix which request is used for error pages.
Browse files Browse the repository at this point in the history
The most recent request in the request stack should be used,
as it is most likely the request containing an exception.

Fixes incorrect error pages generated inside requestAction() calls.

Fixes #2746
  • Loading branch information
markstory committed Apr 3, 2012
1 parent f09e5a3 commit 77f698d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/Error/ExceptionRenderer.php
Expand Up @@ -142,7 +142,7 @@ public function __construct(Exception $exception) {
*/
protected function _getController($exception) {
App::uses('CakeErrorController', 'Controller');
if (!$request = Router::getRequest(false)) {
if (!$request = Router::getRequest(true)) {
$request = new CakeRequest();
}
$response = new CakeResponse(array('charset' => Configure::read('App.encoding')));
Expand Down

0 comments on commit 77f698d

Please sign in to comment.