r16282 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r16281‎ | r16282 | r16283 >
Date:10:56, 30 August 2006
Author:brion
Status:old
Tags:
Comment:
* Fix bug in wfRunHooks which caused corruption of objects in the hook list
References EVIL! Not needed anymore in PHP 5 anyway.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Hooks.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Hooks.php
@@ -64,7 +64,7 @@
6565 if (count($hook) < 1) {
6666 throw new MWException("Empty array in hooks for " . $event . "\n");
6767 } else if (is_object($hook[0])) {
68 - $object =& $wgHooks[$event][$index][0];
 68+ $object = $wgHooks[$event][$index][0];
6969 if (count($hook) < 2) {
7070 $method = "on" . $event;
7171 } else {
@@ -87,7 +87,7 @@
8888 } else if (is_string($hook)) { # functions look like strings, too
8989 $func = $hook;
9090 } else if (is_object($hook)) {
91 - $object =& $wgHooks[$event][$index];
 91+ $object = $wgHooks[$event][$index];
9292 $method = "on" . $event;
9393 } else {
9494 throw new MWException("Unknown datatype in hooks for " . $event . "\n");
@@ -109,7 +109,7 @@
110110 /* Call the hook. */
111111 wfProfileIn( $func );
112112 if( isset( $object ) ) {
113 - $retval = call_user_func_array(array(&$object, $method), $hook_args);
 113+ $retval = call_user_func_array(array($object, $method), $hook_args);
114114 } else {
115115 $retval = call_user_func_array($func, $hook_args);
116116 }
Index: trunk/phase3/RELEASE-NOTES
@@ -164,7 +164,9 @@
165165 * (bug 7075) List registered parser function hooks on Special:Version
166166 * (bug 7059) Introduce "anchorencode" colon function
167167 * Include SVN revision number in {{CURRENTVERSION}} output, where applicable
 168+* Fix bug in wfRunHooks which caused corruption of objects in the hook list
168169
 170+
169171 == Languages updated ==
170172
171173 * Albanian (sq)

Follow-up revisions

RevisionCommit summaryAuthorDate
r16283Fix for bug 7162, doubling of references....brion10:59, 30 August 2006