2 more notices
authoralex-brainstorm <alex-brainstorm@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 5 Jul 2003 00:42:04 +0000 (00:42 +0000)
committeralex-brainstorm <alex-brainstorm@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 5 Jul 2003 00:42:04 +0000 (00:42 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5217 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_asearch.php

index 36d2a45..a4eeb6a 100644 (file)
@@ -284,14 +284,14 @@ function sqimap_asearch($imapConnection, $mailbox_array, $biop_array, $unop_arra
                                foreach ($search_mboxes as $cur_mailbox) {
                                        sqimap_mailbox_select($imapConnection, $cur_mailbox);
                                        s_debug_dump('SELECT',$cur_mailbox);
-                                       if ($cur_biop == 'OR')  /* Merge with previous results */
-                                               $mbox_msgs[$cur_mailbox] = sqimap_array_merge_unique($mbox_msgs[$cur_mailbox], sqimap_run_search($imapConnection, $search_string, $search_charset));
-                                       else {  /* Intersect previous results */
-                                               if (!is_array(asearch_nz($mbox_msgs[$cur_mailbox])))
-                                                       $mbox_msgs[$cur_mailbox] = sqimap_run_search($imapConnection, $search_string, $search_charset);
-                                               else
+                                       if (isset($mbox_msgs[$cur_mailbox])) {
+                                               if ($cur_biop == 'OR')  /* Merge with previous results */
+                                                       $mbox_msgs[$cur_mailbox] = sqimap_array_merge_unique($mbox_msgs[$cur_mailbox], sqimap_run_search($imapConnection, $search_string, $search_charset));
+                                               else    /* Intersect previous results */
                                                        $mbox_msgs[$cur_mailbox] = array_values(array_intersect(sqimap_run_search($imapConnection, $search_string, $search_charset), $mbox_msgs[$cur_mailbox]));
                                        }
+                                       else /* No previous results */
+                                               $mbox_msgs[$cur_mailbox] = sqimap_run_search($imapConnection, $search_string, $search_charset);
                                        if (empty($mbox_msgs[$cur_mailbox]))    /* Can happen with intersect, and we need at the end a contiguous array */
                                                unset($mbox_msgs[$cur_mailbox]);
                                }
@@ -309,7 +309,7 @@ function sqimap_asearch($imapConnection, $mailbox_array, $biop_array, $unop_arra
                                        for ($next_crit = $cur_crit+1; $next_crit <= count($where_array); $next_crit++) {
                                                if (empty($exclude_array[$next_crit])) {
                                                        if (asearch_nz($mailbox_array[$next_crit]) == $cur_mailbox)
-                                                               $next_biop = $biop_array[$next_crit];
+                                                               $next_biop = asearch_nz($biop_array[$next_crit]);
                                                        break;
                                                }
                                        }