Changeset 2599 in subversion


Ignore:
Timestamp:
Jun 3, 2009 4:33:28 AM (4 years ago)
Author:
alec
Message:
  • fix sending mail without identity (#1485898)
File:
1 edited

Legend:

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

    r2491 r2599  
    150150 
    151151// parse email address input 
    152 function rcmail_mailto_format($mailto) 
     152function rcmail_email_input_format($mailto) 
    153153{ 
    154154  $regexp = array('/[,;]\s*[\r\n]+/', '/[\r\n]+/', '/[,;]\s*$/m', '/;/', '/(\S{1})(<\S+@\S+>)/U'); 
     
    201201$message_charset = isset($_POST['_charset']) ? $_POST['_charset'] : $input_charset; 
    202202 
    203 $mailto = rcmail_mailto_format(get_input_value('_to', RCUBE_INPUT_POST, TRUE, $message_charset)); 
    204 $mailcc = rcmail_mailto_format(get_input_value('_cc', RCUBE_INPUT_POST, TRUE, $message_charset)); 
    205 $mailbcc = rcmail_mailto_format(get_input_value('_bcc', RCUBE_INPUT_POST, TRUE, $message_charset)); 
     203$mailto = rcmail_email_input_format(get_input_value('_to', RCUBE_INPUT_POST, TRUE, $message_charset)); 
     204$mailcc = rcmail_email_input_format(get_input_value('_cc', RCUBE_INPUT_POST, TRUE, $message_charset)); 
     205$mailbcc = rcmail_email_input_format(get_input_value('_bcc', RCUBE_INPUT_POST, TRUE, $message_charset)); 
    206206 
    207207if (empty($mailto) && !empty($mailcc)) { 
     
    216216$identity_arr = rcmail_get_identity($from); 
    217217 
    218 if ($identity_arr) 
     218if (!$identity_arr && ($from = rcmail_email_input_format($from))) { 
     219  if (preg_match('/(<\S+@\S+)/', $from, $m)) 
     220    $identity_arr['mailto'] = $m[1]; 
     221} else 
    219222  $from = $identity_arr['mailto']; 
    220223 
     
    264267 
    265268if (!empty($_POST['_replyto'])) 
    266   $headers['Reply-To'] = rcmail_mailto_format(get_input_value('_replyto', RCUBE_INPUT_POST, TRUE, $message_charset)); 
     269  $headers['Reply-To'] = rcmail_email_input_format(get_input_value('_replyto', RCUBE_INPUT_POST, TRUE, $message_charset)); 
    267270else if (!empty($identity_arr['reply-to'])) 
    268271  $headers['Reply-To'] = $identity_arr['reply-to']; 
Note: See TracChangeset for help on using the changeset viewer.