6.0.0-beta1
10/18/25

[#4159] IMP_Search::listQueries() doesn't check for empty array
Summary IMP_Search::listQueries() doesn't check for empty array
Queue IMP
Queue Version 4.1.2
Type Bug
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester manuel (at) mausz (dot) at
Created 07/14/2006 (7036 days ago)
Due
Updated 07/14/2006 (7036 days ago)
Assigned 07/14/2006 (7036 days ago)
Resolved 07/14/2006 (7036 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
07/14/2006 05:11:51 PM Michael Slusarz Comment #2
State ⇒ Resolved
Reply to this comment
Fixed in HEAD and 4.1.3.
07/14/2006 04:57:42 PM Chuck Hagenbuch Assigned to Michael Slusarz
State ⇒ Assigned
 
07/14/2006 11:32:52 AM manuel (at) mausz (dot) at Comment #1
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ IMP_Search::listQueries() doesn't check for empty array
Queue ⇒ IMP
Reply to this comment
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

Saved Queries