summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2012-03-02 13:09:05 +0000
committeralecpl <alec@alec.pl>2012-03-02 13:09:05 +0000
commit82d69583fdef54e70189d3f8eae2d2175ff5b5e2 (patch)
tree5ab1839f9960b6f2736cbdad8497b56b79dd798d
parenta38c8ebdd2fbe6f4042fda9e7e5a803733747146 (diff)
- Fixed double-quotes handling in recipient names
-rw-r--r--program/steps/mail/sendmail.inc6
1 files changed, 5 insertions, 1 deletions
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index 826f73135..bb2bd2732 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -179,7 +179,11 @@ function rcmail_email_input_format($mailto, $count=false, $check=true)
// address with name (handle name)
} else if (preg_match('/<*'.$email_regexp.'>*$/', $item, $matches)) {
$address = $matches[0];
- $name = trim(str_replace($address, '', $item), '" ');
+ $name = trim(str_replace($address, '', $item));
+ if ($name[0] == '"' && $name[count($name)-1] == '"') {
+ $name = substr($name, 1, -1);
+ }
+ $name = stripcslashes($name);
$address = rcube_idn_to_ascii(trim($address, '<>'));
$result[] = format_email_recipient($address, $name);
$item = $address;