]> git.mjollnir.org Git - s9y.git/commitdiff
Fix a "return by reference" glitch
authorgarvinhicking <garvinhicking>
Sat, 27 May 2006 17:50:45 +0000 (17:50 +0000)
committergarvinhicking <garvinhicking>
Sat, 27 May 2006 17:50:45 +0000 (17:50 +0000)
include/plugin_api.inc.php

index e0930ee666d61762884533a44acfb6df5b81ea3b..393560b4247f1e0272d1946dc9a1bdce21bfba27 100644 (file)
@@ -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()