From 60209332e860b00a2489dfdfc2d45da9dfe21f54 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 30 Aug 2006 10:56:17 +0000 Subject: [PATCH] * Fix bug in wfRunHooks which caused corruption of objects in the hook list References EVIL! Not needed anymore in PHP 5 anyway. --- RELEASE-NOTES | 2 ++ includes/Hooks.php | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c42f92bcea..50d151c517 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/Hooks.php b/includes/Hooks.php index 4daffaf322..c00fbc1447 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -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); } -- 2.20.1