From: Brion Vibber Date: Thu, 13 Oct 2005 23:27:38 +0000 (+0000) Subject: * Fix for hook callbacks on objects containing no fields X-Git-Tag: 1.6.0~1425 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/supprimer.php?a=commitdiff_plain;h=3ed747730d5dae5df8508dfb76aadee9340b0647;p=lhc%2Fweb%2Fwiklou.git * Fix for hook callbacks on objects containing no fields A simple 'if($object)' was coming up false; use 'if(isset($object))'. --- 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);