summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-10-12 09:44:04 +0000
committeralecpl <alec@alec.pl>2009-10-12 09:44:04 +0000
commita9bfe21ba6329cf413b8965c8ce225308bcb6e57 (patch)
treee741fde26155377f81de810e1041d80538c92697 /program
parent144b848e105b92224eabeb96275d64923f0d8d7c (diff)
- Fix importing/sending to email address with whitespace (#1486214)
Diffstat (limited to 'program')
-rw-r--r--program/include/main.inc6
-rw-r--r--program/include/rcube_vcard.php1
2 files changed, 4 insertions, 3 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index 6e4cbe1bc..e96840003 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -946,7 +946,7 @@ function format_date($date, $format=NULL)
/**
- * Compose a valid representaion of name and e-mail address
+ * Compose a valid representation of name and e-mail address
*
* @param string E-mail address
* @param string Person name
@@ -957,10 +957,10 @@ function format_email_recipient($email, $name='')
if ($name && $name != $email)
{
// Special chars as defined by RFC 822 need to in quoted string (or escaped).
- return sprintf('%s <%s>', preg_match('/[\(\)\<\>\\\.\[\]@,;:"]/', $name) ? '"'.addcslashes($name, '"').'"' : $name, $email);
+ return sprintf('%s <%s>', preg_match('/[\(\)\<\>\\\.\[\]@,;:"]/', $name) ? '"'.addcslashes($name, '"').'"' : $name, trim($email));
}
else
- return $email;
+ return trim($email);
}
diff --git a/program/include/rcube_vcard.php b/program/include/rcube_vcard.php
index 7dbbb3f71..f574eed14 100644
--- a/program/include/rcube_vcard.php
+++ b/program/include/rcube_vcard.php
@@ -269,6 +269,7 @@ class rcube_vcard
foreach($regs2[1] as $attrid => $attr) {
if ((list($key, $value) = explode('=', $attr)) && $value) {
+ $value = trim($value);
if ($key == 'ENCODING') {
// add next line(s) to value string if QP line end detected
while ($value == 'QUOTED-PRINTABLE' && preg_match('/=$/', $lines[$i]))