Prechádzať zdrojové kódy

updated changelog, fixed folder subscriptions not displaying problem

Luke Ehresman 24 rokov pred
rodič
commit
38b9a97c76
3 zmenil súbory, kde vykonal 19 pridanie a 9 odobranie
  1. 5 0
      ChangeLog
  2. 11 8
      functions/imap_mailbox.php
  3. 3 1
      functions/imap_search.php

+ 5 - 0
ChangeLog

@@ -1,5 +1,10 @@
 Version 1.0.1 -- DEVELOPMENT
 ----------------------------
+- Fixed problems with sending messages
+- Fixed some pass-by-reference calls that caused problems with newer PHP versions
+- Fixed bug that crashed some web servers
+- Fixed bug that didn't display last folder subscribed to
+- Removed requirement of PHP 4.0.1 for array_unique() function
 - Removed unnecessary echo statements by breaking out of PHP
 - Changed evaluation method from using " to ' for speed improvements
 - If no plugin array set in config.php, now handled correctly

+ 11 - 8
functions/imap_mailbox.php

@@ -111,7 +111,7 @@
     **    formatted      - nicely formatted folder name
     **    unformatted    - unformatted, but with delimiter at end removed
     **    unformatted-dm - folder name as it appears in raw response
-	**    unformatted-disp - unformatted without $folder_prefix
+    **    unformatted-disp - unformatted without $folder_prefix
     **
     ******************************************************************************/
    function sqimap_mailbox_parse ($line, $line_lsub, $dm) {
@@ -134,7 +134,7 @@
          $boxesbyname[$mailbox] = $g;
          $parentfolder = readMailboxParent($mailbox, $dm);
          if((eregi("^inbox".quotemeta($dm), $mailbox)) || 
-	    (ereg("^".$folder_prefix, $mailbox)) ||
+            (ereg("^".$folder_prefix, $mailbox)) ||
             ( isset($boxesbyname[$parentfolder]) && (strlen($parentfolder) > 0) ) ) {
             $indent = $dm_count - (countCharInString($folder_prefix, $dm));
             if ($indent)
@@ -198,8 +198,11 @@
       fputs ($imap_stream, "a001 LSUB \"\" \"*\"\r\n");
       $lsub_ary = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
 
-	  /** OS: we don't want to parse last element of array, 'cause it is OK command, so we unset it **/
-	  unset($lsub_ary[count($lsub_ary)-1]);
+      /** OS: we don't want to parse last element of array, 'cause it is OK command, so we unset it **/
+      /** LUKE:  This introduced errors.. do a check first **/
+      if (substr($lsub_ary[count($lsub_ary)-1], 0, 4) == "* OK") {
+        unset($lsub_ary[count($lsub_ary)-1]);
+      }
 
       for ($i=0;$i < count($lsub_ary); $i++) {
          $sorted_lsub_ary[$i] = find_mailbox_name($lsub_ary[$i]);
@@ -265,14 +268,14 @@
          // Then list special folders and their subfolders
          for ($i = 0 ; $i < count($boxes) ; $i++) {
             if ($move_to_trash &&
-	        eregi("^" . quotemeta($trash_folder) . "(" .
-		quotemeta($dm) . ".*)?$", $boxes[$i]["unformatted"])) {
+                eregi("^" . quotemeta($trash_folder) . "(" .
+                quotemeta($dm) . ".*)?$", $boxes[$i]["unformatted"])) {
                $boxesnew[] = $boxes[$i];
                $used[$i] = true;
             }
             elseif ($move_to_sent &&
-	        eregi("^" . quotemeta($sent_folder) . "(" .
-		quotemeta($dm) . ".*)?$", $boxes[$i]["unformatted"])) {
+                eregi("^" . quotemeta($sent_folder) . "(" .
+                quotemeta($dm) . ".*)?$", $boxes[$i]["unformatted"])) {
                $boxesnew[] = $boxes[$i];
                $used[$i] = true;
             }

+ 3 - 1
functions/imap_search.php

@@ -39,8 +39,10 @@ function sqimap_search($imapConnection,$search_where,$search_what,$mailbox,$colo
       #Check to see if a SEARCH Responce was recived
       if (substr($readin[$c],0,9) == "* SEARCH ")
          $messagelist = explode(" ",substr($readin[$c],9));
-      else
+      else if (isset($errors))
          $errors = $errors.$readin[$c];
+      else
+         $errors = $readin[$c];
       $c++;
    }