mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
closes #4842, clean up logic in ErrorHandler
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7228 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
42db64bbb3
commit
605bfa5bc5
1 changed files with 9 additions and 12 deletions
|
@ -98,20 +98,17 @@ class ErrorHandler extends Object {
|
|||
$method = 'error';
|
||||
}
|
||||
|
||||
if ($method == 'error') {
|
||||
$this->dispatchMethod($method, $messages);
|
||||
$this->_stop();
|
||||
} elseif (Configure::read() == 0 && (isset($code) && $code == 500)) {
|
||||
$this->dispatchMethod('error500', $messages);
|
||||
exit();
|
||||
} elseif (Configure::read() == 0) {
|
||||
$this->dispatchMethod('error404', $messages);
|
||||
$this->_stop();
|
||||
} else {
|
||||
$this->dispatchMethod($method, $messages);
|
||||
$this->_stop();
|
||||
if ($method !== 'error') {
|
||||
if (Configure::read() == 0){
|
||||
$method = 'error404';
|
||||
if(isset($code) && $code == 500) {
|
||||
$method = 'error500';
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->dispatchMethod($method, $messages);
|
||||
$this->_stop();
|
||||
}
|
||||
/**
|
||||
* Displays an error page (e.g. 404 Not found).
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue