* Fix for hook callbacks on objects containing no fields
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 13 Oct 2005 23:27:38 +0000 (23:27 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 13 Oct 2005 23:27:38 +0000 (23:27 +0000)
A simple 'if($object)' was coming up false; use 'if(isset($object))'.

RELEASE-NOTES
includes/Hooks.php

index f229533..7b4da9e 100644 (file)
@@ -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 ===
index d5aa87d..d19c853 100644 (file)
@@ -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);