소스 검색

Fixed a bug where users that did not log in before would get tons of
Warning: REG_EBRACK in .../imap_mailbox.php on line XXX
Apparently the Trash and Sent folder need to be escaped, just in case they
have some special characters in them.

This only seemed to happen with FreeBSD and special folder names for the
Sent and Trash folder. Thanks to John Bolster for helping out!

Tyler Akins 24 년 전
부모
커밋
4c2e20e119
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      functions/imap_mailbox.php

+ 4 - 4
functions/imap_mailbox.php

@@ -258,14 +258,14 @@
 
          // Then list special folders and their subfolders
          for ($i = 0 ; $i <= count($boxes) ; $i++) {
-            if((eregi("^".$trash_folder.'$', $boxes[$i]["unformatted"]) ||
-                eregi("^".$trash_folder.quotemeta($dm), $boxes[$i]["unformatted"]) )  &&
+            if((eregi("^".quotemeta($trash_folder).'$', $boxes[$i]["unformatted"]) ||
+                eregi("^".quotemeta($trash_folder).quotemeta($dm), $boxes[$i]["unformatted"]) )  &&
                ($move_to_trash)) {        
                $boxesnew[] = $boxes[$i];
                $boxes[$i]["used"] = true;
             }
-            else if((eregi("^".$sent_folder.'$', $boxes[$i]["unformatted"]) ||
-                     eregi("^".$sent_folder.quotemeta($dm), $boxes[$i]["unformatted"]) )  &&
+            else if((eregi("^".quotemeta($sent_folder).'$', $boxes[$i]["unformatted"]) ||
+                     eregi("^".quotemeta($sent_folder).quotemeta($dm), $boxes[$i]["unformatted"]) )  &&
                     ($move_to_sent)) {        
                $boxesnew[] = $boxes[$i];
                $boxes[$i]["used"] = true;