From abb32edbeb0e4c9be7b38c4162bd8c7cbd06dc74 Mon Sep 17 00:00:00 2001 From: svncommit Date: Mon, 31 Jul 2006 22:07:45 +0000 Subject: #1399714 - fixed commas in identity fullname field --- program/steps/mail/sendmail.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'program/steps/mail/sendmail.inc') diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc index d0e0f784e..b48dc0cf5 100644 --- a/program/steps/mail/sendmail.inc +++ b/program/steps/mail/sendmail.inc @@ -53,8 +53,9 @@ function rcmail_get_identity($id) { $sql_arr = $DB->fetch_assoc($sql_result); $out = $sql_arr; + $name = strpos($sql_arr['name'], ",") ? '"'.$sql_arr['name'].'"' : $sql_arr['name']; $out['string'] = sprintf('%s <%s>', - rcube_charset_convert($sql_arr['name'], $CHARSET, $OUTPUT->get_charset()), + rcube_charset_convert($name, $CHARSET, $OUTPUT->get_charset()), $sql_arr['mailto']); return $out; } @@ -87,7 +88,7 @@ $message_charset = isset($_POST['_charset']) ? $_POST['_charset'] : $input_chars $mailto_regexp = array('/[,;]\s*[\r\n]+/', '/[\r\n]+/', '/[,;]\s*$/m'); $mailto_replace = array(', ', ', ', ''); -// repalce new lines and strip ending ', ' +// replace new lines and strip ending ', ' $mailto = preg_replace($mailto_regexp, $mailto_replace, get_input_value('_to', RCUBE_INPUT_POST, TRUE, $message_charset)); // decode address strings -- cgit v1.2.3