From 6b79c8d375f80770497061a92ed582401d00314e Mon Sep 17 00:00:00 2001 From: mark_story Date: Sun, 8 Nov 2009 14:07:25 -0500 Subject: [PATCH] Adding checks for parent classname when converting error method names. Fixes #273 --- cake/libs/error.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cake/libs/error.php b/cake/libs/error.php index 26ef72a5253..7861ec26990 100644 --- a/cake/libs/error.php +++ b/cake/libs/error.php @@ -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'; }