From a9bfe21ba6329cf413b8965c8ce225308bcb6e57 Mon Sep 17 00:00:00 2001 From: alecpl Date: Mon, 12 Oct 2009 09:44:04 +0000 Subject: - Fix importing/sending to email address with whitespace (#1486214) --- program/include/main.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'program/include/main.inc') 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); } -- cgit v1.2.3