diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-10-08 08:42:59 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-10-08 08:42:59 +0000 |
| commit | e7332064d6f515d314a88f21d6b6b0d9e7bf1a3a (patch) | |
| tree | 2d42e2364905c7e1f1bf65911e768e72d279ad9b /roundcubemail/program | |
| parent | 3811629910dd010659fcaafa939cb6e9b07a4738 (diff) | |
#1485294: Add recipients address small validation
git-svn-id: https://svn.roundcube.net/trunk@1958 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
| -rw-r--r-- | roundcubemail/program/steps/mail/sendmail.inc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/roundcubemail/program/steps/mail/sendmail.inc b/roundcubemail/program/steps/mail/sendmail.inc index 4706af22f..784d46a8f 100644 --- a/roundcubemail/program/steps/mail/sendmail.inc +++ b/roundcubemail/program/steps/mail/sendmail.inc @@ -145,10 +145,10 @@ $message_id = sprintf('<%s@%s>', md5(uniqid('rcmail'.rand(),true)), $RCMAIL->con $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)); |
