Browse Source

fixed problem with usort getting bad data in some instances

Luke Ehresman 25 years ago
parent
commit
1af7e269a9
3 changed files with 15 additions and 8 deletions
  1. 5 6
      config/conf.pl
  2. 9 2
      functions/imap_mailbox.php
  3. 1 0
      functions/mailbox_display.php

+ 5 - 6
config/conf.pl

@@ -1091,12 +1091,11 @@ sub command61 {
 }   
 
 sub command62 {
-   print "Although our project goals stated that we would stay 100% HTML with\n";
-   print "no javascript, some of our developers have developed a wonderful\n";
-   print "javascript interface for searching for email addresses in your address\n";
-   print "books.  In order to stick with our project goals, and without having\n";
-   print "to refuse their work, we also developed an HTML version of address\n";
-   print "book searching.\n";
+   print "Some of our developers have come up with very good javascript interface\n";
+   print "for searching through address books, however, our original goals said\n";
+   print "that we would be 100% HTML.  In order to make it possible to use their\n";
+   print "interface, and yet stick with our goals, we have also written a plain\n";
+   print "HTML version of the search.  Here, you can choose which version to use.\n";
    print "\n";
    print "This is just the default value.  It is also a user option that each\n";
    print "user can configure individually\n";

+ 9 - 2
functions/imap_mailbox.php

@@ -173,7 +173,12 @@
       if ($inbox_subscribed == false || $inbox_in_list == false) {
          fputs ($imap_stream, "a001 LIST \"\" \"INBOX\"\r\n");
          $inbox_ary = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
-         $sorted_list_ary[count($sorted_list_ary)] = $inbox_ary[0];
+
+         $pos = count($sorted_list_ary);
+         $sorted_list_ary[$pos] = $inbox_ary[0];
+
+         $pos = count($sorted_lsub_ary);
+         $sorted_lsub_ary[$pos] = find_mailbox_name($inbox_ary[0]);
       }
 
 		$boxes = sqimap_mailbox_parse ($sorted_list_ary, $sorted_lsub_ary, $dm);
@@ -267,7 +272,9 @@
          }
          $g++;
       }
-      $boxes = ary_sort ($boxes, "unformatted", 1);
+      if ($boxes) {
+         $boxes = ary_sort ($boxes, "unformatted", 1);
+      }
       return $boxes;
    }
    

+ 1 - 0
functions/mailbox_display.php

@@ -296,5 +296,6 @@
          echo "<A HREF=\"right_main.php?use_mailbox_cache=1&startMessage=$nextGroup&mailbox=$urlMailbox\" TARGET=\"right\">" . _("Next") . "</A>\n";
       }
       echo "</TD></TR></TABLE>"; /** End of message-list table */
+
    }
 ?>