* Fix bug in wfRunHooks which caused corruption of objects in the hook list
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 30 Aug 2006 10:56:17 +0000 (10:56 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 30 Aug 2006 10:56:17 +0000 (10:56 +0000)
References EVIL! Not needed anymore in PHP 5 anyway.

RELEASE-NOTES
includes/Hooks.php

index c42f92b..50d151c 100644 (file)
@@ -164,6 +164,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 7075) List registered parser function hooks on Special:Version
 * (bug 7059) Introduce "anchorencode" colon function
 * Include SVN revision number in {{CURRENTVERSION}} output, where applicable
+* Fix bug in wfRunHooks which caused corruption of objects in the hook list
+
 
 == Languages updated ==
 
index 4daffaf..c00fbc1 100644 (file)
@@ -64,7 +64,7 @@ function wfRunHooks($event, $args = null) {
                        if (count($hook) < 1) {
                                throw new MWException("Empty array in hooks for " . $event . "\n");
                        } else if (is_object($hook[0])) {
-                               $object =& $wgHooks[$event][$index][0];
+                               $object = $wgHooks[$event][$index][0];
                                if (count($hook) < 2) {
                                        $method = "on" . $event;
                                } else {
@@ -87,7 +87,7 @@ function wfRunHooks($event, $args = null) {
                } else if (is_string($hook)) { # functions look like strings, too
                        $func = $hook;
                } else if (is_object($hook)) {
-                       $object =& $wgHooks[$event][$index];
+                       $object = $wgHooks[$event][$index];
                        $method = "on" . $event;
                } else {
                        throw new MWException("Unknown datatype in hooks for " . $event . "\n");
@@ -109,7 +109,7 @@ function wfRunHooks($event, $args = null) {
                /* Call the hook. */
                wfProfileIn( $func );
                if( isset( $object ) ) {
-                       $retval = call_user_func_array(array(&$object, $method), $hook_args);
+                       $retval = call_user_func_array(array($object, $method), $hook_args);
                } else {
                        $retval = call_user_func_array($func, $hook_args);
                }