mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Only try to use CakeErrorController if AppController exists.
This fixes missing error pages when there are parse errors in AppController. Fixes #3850
This commit is contained in:
parent
76f4d10d13
commit
41e0c524f2
1 changed files with 8 additions and 6 deletions
|
@ -151,6 +151,7 @@ class ExceptionRenderer {
|
||||||
$response->header($exception->responseHeader());
|
$response->header($exception->responseHeader());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (class_exists('AppController')) {
|
||||||
try {
|
try {
|
||||||
$controller = new CakeErrorController($request, $response);
|
$controller = new CakeErrorController($request, $response);
|
||||||
$controller->startupProcess();
|
$controller->startupProcess();
|
||||||
|
@ -159,6 +160,7 @@ class ExceptionRenderer {
|
||||||
$controller->RequestHandler->startup($controller);
|
$controller->RequestHandler->startup($controller);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (empty($controller)) {
|
if (empty($controller)) {
|
||||||
$controller = new Controller($request, $response);
|
$controller = new Controller($request, $response);
|
||||||
$controller->viewPath = 'Errors';
|
$controller->viewPath = 'Errors';
|
||||||
|
|
Loading…
Add table
Reference in a new issue