瀏覽代碼

fixed a problem with preg_match when mailbox delimiter is "/"

jmunro 23 年之前
父節點
當前提交
ac4448bf2c
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      functions/imap_mailbox.php

+ 6 - 1
functions/imap_mailbox.php

@@ -468,7 +468,12 @@ function sqimap_mailbox_list($imap_stream) {
                     $used[$k] = true;
                 }
                 $spec_sub = str_replace(' ', '', $box['formatted']);
-                if (!$used[$k] && preg_match("/^$default_folder_prefix(Sent|Drafts|Trash).{1}$spec_sub$/", $box['unformatted']) ) {
+
+               /* In case of problems with preg
+                  here is a ereg version
+                 if (!$used[$k] && ereg("^$default_folder_prefix(Sent|Drafts|Trash).{1}$spec_sub$", $box['unformatted']) ) { */
+                 
+                if (!$used[$k] && preg_match("?^$default_folder_prefix(Sent|Drafts|Trash).{1}$spec_sub$?", $box['unformatted']) ) {
                     $boxesnew[] = $box;
                     $used[$k] = true;
                 }