Opened 5 years ago

Closed 5 years ago

#1484738 closed Bugs (fixed)

Mailbox delimiter / causes errors

Reported by: seansan Owned by: till
Priority: 5 Milestone: 0.1-stable
Component: Client Scripts Version: git-master
Severity: normal Keywords: delimiter
Cc:

Description

My mailbox delimiter is / and causes errors in certain locations in the program.

>> -- [02-Feb-2008 10:59:47] PHP Warning:  preg_match() [<a
>> href='function.preg-match'>function.preg-match</a>]:
>> Unknown modifier '/' in /program/include/rcube_imap.inc on line 1774
>> -- [02-Feb-2008 10:59:47] PHP Warning:  preg_match() [<a
>> href='function.preg-match'>function.preg-match</a>]:
>> Unknown modifier '/' in /program/steps/settings/manage_folders.inc on line
>> 122

Could be more locations.

Change History (5)

comment:1 Changed 5 years ago by till

  • Owner set to till
  • Status changed from new to assigned

God damnit. :)

This is because / is not escaped inside the regex. I will investigate this ASAP.

comment:2 Changed 5 years ago by till

I'm puzzled.

In both cases there is "preg_quote()" around it.

For the first error, here is some debug code in form of patch to rcube_imap.inc, make sure you "svn up'ed" before. I am on [611a6a71] right now.

Index: /Users/till/Documents/Aptana IDE Beta/roundcube-trunk/program/include/rcube_imap.inc
===================================================================
--- /Users/till/Documents/Aptana IDE Beta/roundcube-trunk/program/include/rcube_imap.inc	(revision 985)
+++ /Users/till/Documents/Aptana IDE Beta/roundcube-trunk/program/include/rcube_imap.inc	(working copy)
@@ -1771,7 +1771,19 @@
           $deleted = TRUE;
 
         foreach ($all_mboxes as $c_mbox)
-          if (preg_match('/^'.preg_quote($mailbox.$this->delimiter).'/', $c_mbox))
+          {
+          $regex = '/^'.preg_quote($mailbox.$this->delimiter).'/';
+          
+          $log_entry = sprintf(
+            "[%s] Regex: %s\n",
+            date("d-M-Y H:i:s O"),
+            $regex);
+          if ($fp = @fopen($CONFIG['log_dir'].'/sendmail', 'a'))
+            {
+            fwrite($fp, $log_entry);
+            fclose($fp);
+            }
+          if (preg_match($regex, $c_mbox))
             {
             iil_C_UnSubscribe($this->conn, $c_mbox);
             $result = iil_C_DeleteFolder($this->conn, $c_mbox);
@@ -1778,6 +1790,7 @@
             if ($result>=0)
               $deleted = TRUE;
             }
+          }
         }
 
     // clear mailboxlist cache

comment:3 Changed 5 years ago by till

This is a quick copy/paste job. The Regex should be in logs/sendmail

comment:4 Changed 5 years ago by thomasb

preg_quote() just needs a second parameter specifying the used delimiter '/'.

comment:5 Changed 5 years ago by till

  • Resolution set to fixed
  • Status changed from assigned to closed

Overread that.

Fixed in SVN!

Note: See TracTickets for help on using tickets.