[Svn] r1958 - trunk/roundcubemail/program/steps/mail

trac at roundcube.net trac at roundcube.net
Wed Oct 8 10:42:59 CEST 2008


Author: alec
Date: 2008-10-08 03:42:59 -0500 (Wed, 08 Oct 2008)
New Revision: 1958

Modified:
   trunk/roundcubemail/program/steps/mail/sendmail.inc
Log:
#1485294: Add recipients address small validation


Modified: trunk/roundcubemail/program/steps/mail/sendmail.inc
===================================================================
--- trunk/roundcubemail/program/steps/mail/sendmail.inc	2008-10-08 08:04:25 UTC (rev 1957)
+++ trunk/roundcubemail/program/steps/mail/sendmail.inc	2008-10-08 08:42:59 UTC (rev 1958)
@@ -145,10 +145,10 @@
 $input_charset = $OUTPUT->get_charset();
 $message_charset = isset($_POST['_charset']) ? $_POST['_charset'] : $input_charset;
 
-$mailto_regexp = array('/[,;]\s*[\r\n]+/', '/[\r\n]+/', '/[,;]\s*$/m', '/;/');
-$mailto_replace = array(', ', ', ', '', ',');
+$mailto_regexp = array('/[,;]\s*[\r\n]+/', '/[\r\n]+/', '/[,;]\s*$/m', '/;/', '/(\S{1})(<\S+@\S+>)/U');
+$mailto_replace = array(', ', ', ', '', ',', '\\1 \\2');
 
-// replace new lines and strip ending ', '
+// replace new lines and strip ending ', ', make address strings more valid also
 $mailto = preg_replace($mailto_regexp, $mailto_replace, get_input_value('_to', RCUBE_INPUT_POST, TRUE, $message_charset));
 $mailcc = preg_replace($mailto_regexp, $mailto_replace, get_input_value('_cc', RCUBE_INPUT_POST, TRUE, $message_charset));
 $mailbcc = preg_replace($mailto_regexp, $mailto_replace, get_input_value('_bcc', RCUBE_INPUT_POST, TRUE, $message_charset));

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list