Changeset 0c6f4b8 in github for program/include/rcube_imap.inc


Ignore:
Timestamp:
Mar 21, 2008 9:29:12 AM (5 years ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
846dd74
Parents:
46bc52b
Message:

Better patch to correctly quote email recipient strings (from #1484191)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/include/rcube_imap.inc

    r52f8caf r0c6f4b8  
    22732273    $a = $this->_parse_address_list($input, $decode); 
    22742274    $out = array(); 
     2275    // Special chars as defined by RFC 822 need to in quoted string (or escaped). 
     2276    $special_chars = '[\(\)\<\>\\\.\[\]@,;:"]'; 
    22752277     
    22762278    if (!is_array($a)) 
     
    22862288      $name = preg_replace(array('/^[\'"]/', '/[\'"]$/'), '', trim($val['name'])); 
    22872289      if ($name && $address && $name != $address) 
    2288         $string = sprintf('%s <%s>', preg_match('/[,;<>]/', $name) ? '"'.addcslashes($name, '"').'"' : $name, $address); 
     2290        $string = sprintf('%s <%s>', preg_match("/$special_chars/", $name) ? '"'.addcslashes($name, '"').'"' : $name, $address); 
    22892291      else if ($address) 
    22902292        $string = $address; 
Note: See TracChangeset for help on using the changeset viewer.