[Svn] r4827 - trunk/roundcubemail/program/include

trac at roundcube.net trac at roundcube.net
Thu Jun 2 08:19:28 CEST 2011


Author: alec
Date: 2011-06-02 01:19:27 -0500 (Thu, 02 Jun 2011)
New Revision: 4827

Modified:
   trunk/roundcubemail/program/include/main.inc
Log:
- Replace preg_match() with faster strpos()


Modified: trunk/roundcubemail/program/include/main.inc
===================================================================
--- trunk/roundcubemail/program/include/main.inc	2011-06-01 19:31:53 UTC (rev 4826)
+++ trunk/roundcubemail/program/include/main.inc	2011-06-02 06:19:27 UTC (rev 4827)
@@ -1352,15 +1352,15 @@
     $classes = array('mailbox');
 
     // set special class for Sent, Drafts, Trash and Junk
-    if ($folder['id']==$CONFIG['sent_mbox'])
+    if ($folder['id'] == $CONFIG['sent_mbox'])
       $classes[] = 'sent';
-    else if ($folder['id']==$CONFIG['drafts_mbox'])
+    else if ($folder['id'] == $CONFIG['drafts_mbox'])
       $classes[] = 'drafts';
-    else if ($folder['id']==$CONFIG['trash_mbox'])
+    else if ($folder['id'] == $CONFIG['trash_mbox'])
       $classes[] = 'trash';
-    else if ($folder['id']==$CONFIG['junk_mbox'])
+    else if ($folder['id'] == $CONFIG['junk_mbox'])
       $classes[] = 'junk';
-    else if ($folder['id']=='INBOX')
+    else if ($folder['id'] == 'INBOX')
       $classes[] = 'inbox';
     else
       $classes[] = '_'.asciiwords($folder_class ? $folder_class : strtolower($folder['id']), true);
@@ -1370,7 +1370,7 @@
     if ($folder['id'] == $mbox_name)
       $classes[] = 'selected';
 
-    $collapsed = preg_match('/&'.rawurlencode($folder['id']).'&/', $RCMAIL->config->get('collapsed_folders'));
+    $collapsed = strpos($CONFIG['collapsed_folders'], '&'.rawurlencode($folder['id']).'&') !== false;
     $unread = $msgcounts ? intval($msgcounts[$folder['id']]['UNSEEN']) : 0;
 
     if ($folder['virtual'])

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list