Changeset acff900 in github


Ignore:
Timestamp:
Oct 8, 2008 4:42:59 AM (5 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
e51ef05
Parents:
89bafae
Message:

#1485294: Add recipients address small validation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/steps/mail/sendmail.inc

    rfd51e0f racff900  
    146146$message_charset = isset($_POST['_charset']) ? $_POST['_charset'] : $input_charset; 
    147147 
    148 $mailto_regexp = array('/[,;]\s*[\r\n]+/', '/[\r\n]+/', '/[,;]\s*$/m', '/;/'); 
    149 $mailto_replace = array(', ', ', ', '', ','); 
    150  
    151 // replace new lines and strip ending ', ' 
     148$mailto_regexp = array('/[,;]\s*[\r\n]+/', '/[\r\n]+/', '/[,;]\s*$/m', '/;/', '/(\S{1})(<\S+@\S+>)/U'); 
     149$mailto_replace = array(', ', ', ', '', ',', '\\1 \\2'); 
     150 
     151// replace new lines and strip ending ', ', make address strings more valid also 
    152152$mailto = preg_replace($mailto_regexp, $mailto_replace, get_input_value('_to', RCUBE_INPUT_POST, TRUE, $message_charset)); 
    153153$mailcc = preg_replace($mailto_regexp, $mailto_replace, get_input_value('_cc', RCUBE_INPUT_POST, TRUE, $message_charset)); 
Note: See TracChangeset for help on using the changeset viewer.