PHP bug: using a global array in a foreach doesn't work recursively
git-svn-id: file:///home/shish/svn/shimmie2/trunk@247 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
c52b584f3d
commit
2204711880
1 changed files with 3 additions and 2 deletions
|
@ -326,8 +326,9 @@ function add_event_listener($block, $pos=50) {
|
|||
|
||||
function send_event($event) {
|
||||
global $_event_listeners;
|
||||
ksort($_event_listeners);
|
||||
foreach($_event_listeners as $listener) {
|
||||
$my_event_listeners = $_event_listeners;
|
||||
ksort($my_event_listeners);
|
||||
foreach($my_event_listeners as $listener) {
|
||||
$listener->receive_event($event);
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue