Browse Source

Fix which request is used for error pages.

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
mark_story 14 years ago
parent
commit
77f698dbcd
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/Cake/Error/ExceptionRenderer.php

+ 1 - 1
lib/Cake/Error/ExceptionRenderer.php

@@ -142,7 +142,7 @@ class ExceptionRenderer {
  */
 	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')));