mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Handle MissingViewExceptions better.
When Router::parseExtensions() is enabled for a file extension that does not map to a view an infinite loop of attempting to render View/$ext/error500.ctp will be entered. When catching a MissingViewException check if we were trying to render an error500. If we were, revert to safe rendering as we might enter a loop.
This commit is contained in:
parent
604898ad0b
commit
2ba117eeda
1 changed files with 4 additions and 3 deletions
|
@ -272,10 +272,11 @@ class ExceptionRenderer {
|
|||
$this->controller->afterFilter();
|
||||
$this->controller->response->send();
|
||||
} catch (MissingViewException $e) {
|
||||
try {
|
||||
$this->_outputMessage('error500');
|
||||
} catch (Exception $e) {
|
||||
$attributes = $e->getAttributes();
|
||||
if (isset($attributes['file']) && strpos($attributes['file'], 'error500') !== false) {
|
||||
$this->_outputMessageSafe('error500');
|
||||
} else {
|
||||
$this->_outputMessage('error500');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$this->_outputMessageSafe('error500');
|
||||
|
|
Loading…
Add table
Reference in a new issue