From 3ed747730d5dae5df8508dfb76aadee9340b0647 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 13 Oct 2005 23:27:38 +0000 Subject: [PATCH] * Fix for hook callbacks on objects containing no fields A simple 'if($object)' was coming up false; use 'if(isset($object))'. --- RELEASE-NOTES | 1 + includes/Hooks.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index f229533a3c..7b4da9e468 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -148,6 +148,7 @@ fully support the editing toolbar, but was found to be too confusing. * (bug 3684) Fix typo in fatal error backtraces in Hooks.php * (bug 3682) LanguageSr.php - added convertPlural * (bug 2369) Add separate message for input box on Special:Prefixindex +* Fix for hook callbacks on objects containing no fields === Caveats === diff --git a/includes/Hooks.php b/includes/Hooks.php index d5aa87d520..d19c853a4b 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -107,13 +107,13 @@ if (defined('MEDIAWIKI')) { } - if ( $object ) { + if ( isset( $object ) ) { $func = get_class( $object ) . '::' . $method; } /* Call the hook. */ wfProfileIn( $func ); - if ($object) { + if( isset( $object ) ) { $retval = call_user_func_array(array($object, $method), $hook_args); } else { $retval = call_user_func_array($func, $hook_args); -- 2.20.1