Skip to content

Commit

Permalink
Adding checks for parent classname when converting error method names.
Browse files Browse the repository at this point in the history
…Fixes #273
  • Loading branch information
markstory committed Nov 8, 2009
1 parent 95cafc7 commit 6b79c8d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cake/libs/error.php
Expand Up @@ -108,10 +108,13 @@ function __construct($method, $messages) {
if (!in_array(strtolower($method), array_map('strtolower', get_class_methods($this)))) {
$method = 'error';
}

if ($method !== 'error') {
if (Configure::read('debug') == 0) {
$parentMethods = get_class_methods(get_parent_class($this));
$parentClass = get_parent_class($this);
if (strtolower($parentClass) != 'errorhandler') {
$method = 'error404';
}
$parentMethods = get_class_methods($parentClass);
if (in_array($method, $parentMethods)) {
$method = 'error404';
}
Expand Down

0 comments on commit 6b79c8d

Please sign in to comment.