From: garvinhicking Date: Sat, 27 May 2006 17:50:45 +0000 (+0000) Subject: Fix a "return by reference" glitch X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=451e71928848e2cd5b04f4dcdc2c7f323252a97a;p=s9y.git Fix a "return by reference" glitch --- diff --git a/include/plugin_api.inc.php b/include/plugin_api.inc.php index e0930ee..393560b 100644 --- a/include/plugin_api.inc.php +++ b/include/plugin_api.inc.php @@ -974,7 +974,11 @@ class serendipity_plugin_api { return false; } - $plugins =& serendipity_plugin_api::get_event_plugins(); + // We can NOT use a "return by reference" here, because then when + // a plugin executes another event_hook, the referenced variable within + // that call will overwrite the previous original plugin listing and + // skip the execution of any follow-up plugins. + $plugins = serendipity_plugin_api::get_event_plugins(); if (is_array($plugins)) { // foreach() operates on copies of values, but we want to operate on references, so we use while()