Update
[squirrelmail.git] / functions / imap_search.php
index ba69165aa2916ea317ba42e2e300868de15094b4..fbc9baeb551345657dbc1f549faa7eeff5750bbe 100644 (file)
@@ -174,6 +174,12 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo
             $msg = ''; 
         }
         if ($search_all != 'all') {
+           if ( !isset( $start_msg ) ) {
+               $start_msg =0;
+           }
+           if ( !isset( $sort ) ) {
+                $sort = 0;
+           }
             mail_message_listing_beginning( $imapConnection,
                 "move_messages.php?msg=$msg&mailbox=$urlMailbox&pos=$pos&where=" . urlencode($search_where) . "&what=".urlencode($search_what),
             $mailbox,
@@ -195,7 +201,7 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo
                        echo '</td></tr>';
         }
         echo '</table></td></tr></table></form>';
-               $count_all += count($msgs);
+               $count_all = count($msgs);
     }
                return $count_all;
 }