diff --git a/lib/Cake/Controller/CakeErrorController.php b/lib/Cake/Controller/CakeErrorController.php index 53f500217..6b0423a32 100644 --- a/lib/Cake/Controller/CakeErrorController.php +++ b/lib/Cake/Controller/CakeErrorController.php @@ -52,14 +52,12 @@ class CakeErrorController extends AppController { */ public function __construct($request = null, $response = null) { parent::__construct($request, $response); - if ( - count(Router::extensions()) && - !array_key_exists('RequestHandler', $this->components) && - !in_array('RequestHandler', $this->components, true) - ) { - $this->components[] = 'RequestHandler'; - } $this->constructClasses(); + if (count(Router::extensions()) && + !$this->Components->attached('RequestHandler') + ) { + $this->RequestHandler = $this->Components->load('RequestHandler'); + } if ($this->Components->enabled('Auth')) { $this->Components->disable('Auth'); }