Browse Source

Merge pull request #915 from bar/master-cake-error

Avoid duplicating RequestHandler component when rendering Errors.
Mark Story 13 years ago
parent
commit
e6512c56fd
1 changed files with 5 additions and 1 deletions
  1. 5 1
      lib/Cake/Controller/CakeErrorController.php

+ 5 - 1
lib/Cake/Controller/CakeErrorController.php

@@ -50,7 +50,11 @@ class CakeErrorController extends AppController {
  */
 	public function __construct($request = null, $response = null) {
 		parent::__construct($request, $response);
-		if (count(Router::extensions())) {
+		if (
+			count(Router::extensions()) &&
+			!array_key_exists('RequestHandler', $this->components) &&
+			!in_array('RequestHandler', $this->components, true)
+		) {
 			$this->components[] = 'RequestHandler';
 		}
 		$this->constructClasses();