From 6a4bccb7965e281f0a9ef11b90cd71058924ca16 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Sat, 05 Mar 2011 03:01:42 -0500
Subject: [PATCH] - Fix some emails are not shown using Cyrus IMAP (#1487820)

---
 program/include/rcube_imap_generic.php |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php
index cc590e0..c867911 100644
--- a/program/include/rcube_imap_generic.php
+++ b/program/include/rcube_imap_generic.php
@@ -1344,7 +1344,7 @@
                         $result[$id] = '';
                     }
                 } else if ($mode == 2) {
-                    if (preg_match('/\((UID|RFC822\.SIZE) ([0-9]+)/', $line, $matches)) {
+                    if (preg_match('/(UID|RFC822\.SIZE) ([0-9]+)/', $line, $matches)) {
                         $result[$id] = trim($matches[2]);
                     } else {
                         $result[$id] = 0;
@@ -3321,7 +3321,7 @@
         else if ($force_quotes ||
             preg_match('/([\x00-\x20\x28-\x29\x7B\x25\x2A\x22\x5B\x5C\x5D\x7F]+)/', $string)
         ) {
-            return '"' . strtr($string, array('"'=>'\\"', '\\' => '\\\\')) . '"';
+            return '"' . addcslashes($string, '\\"') . '"';
         }
 
         // atom
@@ -3330,7 +3330,7 @@
 
     static function unEscape($string)
     {
-        return strtr($string, array('\\"'=>'"', '\\\\' => '\\'));
+        return stripslashes($string);
     }
 
     /**

--
Gitblit v1.9.1