From a649e0488a8913f73443390703692e96767ab871 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 21 Oct 2013 07:34:49 -0400
Subject: [PATCH] Fix failing vCard import when email address field contains spaces (#1489386)

---
 program/lib/Roundcube/rcube_vcard.php |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/program/lib/Roundcube/rcube_vcard.php b/program/lib/Roundcube/rcube_vcard.php
index b044793..5f74ccb 100644
--- a/program/lib/Roundcube/rcube_vcard.php
+++ b/program/lib/Roundcube/rcube_vcard.php
@@ -617,8 +617,8 @@
                 $enc   = null;
 
                 foreach($regs2[1] as $attrid => $attr) {
+                    $attr = preg_replace('/[\s\t\n\r\0\x0B]/', '', $attr);
                     if ((list($key, $value) = explode('=', $attr)) && $value) {
-                        $value = trim($value);
                         if ($key == 'ENCODING') {
                             $value = strtoupper($value);
                             // add next line(s) to value string if QP line end detected
@@ -797,7 +797,7 @@
                 return $result;
             }
 
-            $s = strtr($s, $rep2);
+            $s = trim(strtr($s, $rep2));
         }
 
         // some implementations (GMail) use non-standard backslash before colon (#1489085)

--
Gitblit v1.9.1