[Tickets #4159] NEW: IMP_Search::listQueries() doesn't check for empty array

bugs@bugs.horde.org bugs at bugs.horde.org
Fri Jul 14 04:32:52 PDT 2006


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=4159
-----------------------------------------------------------------------
 Ticket             | 4159
 Created By         | manuel at mausz.at
 Summary            | IMP_Search::listQueries() doesn't check for empty array
 Queue              | IMP
 Version            | 4.1.2
 State              | Unconfirmed
 Priority           | 1. Low
 Type               | Bug
 Owners             | 
-----------------------------------------------------------------------


manuel at mausz.at (2006-07-14 04:32) wrote:

If vFolders are disabled, a php warning occur in the tree as well in the
"Server and Folder Information"-settings.

PHP Warning:
Warning: Invalid argument supplied for foreach() in
/path/to/imp/lib/Search.php on line 478

Simple Patch:
--- lib/Search.php.orig Fri Jul 14 13:30:32 2006
+++ lib/Search.php      Fri Jul 14 13:31:21 2006
@@ -475,6 +475,10 @@
     {
         $vfolders = array();

+        if (empty($_SESSION['imp']['search']['q'])) {
+            return $vfolders;
+        }
+
         foreach ($_SESSION['imp']['search']['q'] as $key => $val) {
             if (!$vfolder || !empty($val['vfolder'])) {
                 $vfolders[$key] = $this->getLabel($key);

Regards,
/ manuel




More information about the bugs mailing list