[dev] Passing anonymous arrays by reference

John Morrissey jwm at horde.net
Thu Mar 24 10:21:54 PST 2005


I was working with FRAMEWORK_3 today and noticed that black/whitelisting
individual messages didn't work because message.php is passing an anonymous
array to IMP_Filter. I gather there isn't any way to pass anonymous arrays
by reference; it this patch OK?

Index: message.php
===================================================================
--- message.php (revision 4985)
+++ message.php (working copy)
@@ -62,12 +62,14 @@
 switch ($actionID) {
 case 'blacklist':
     require_once IMP_BASE . '/lib/Filter.php';
-    IMP_Filter::blacklistMessage(array($imp_mailbox->getIndex()));
+    $indices = array($imp_mailbox->getIndex());
+    IMP_Filter::blacklistMessage($indices);
     break;

 case 'whitelist':
     require_once IMP_BASE . '/lib/Filter.php';
-    IMP_Filter::whitelistMessage(array($imp_mailbox->getIndex()));
+    $indices = array($imp_mailbox->getIndex());
+    IMP_Filter::whitelistMessage($indices);
     break;

 case 'print_message':

john
-- 
John Morrissey          _o            /\         ----  __o
jwm at horde.net        _-< \_          /  \       ----  <  \,
www.horde.net/    __(_)/_(_)________/    \_______(_) /_(_)__


More information about the dev mailing list