Ignore:
Timestamp:
Aug 9, 2011 5:46:54 AM (22 months ago)
Author:
alec
Message:
  • Fix handling of email addresses with quoted local part (#1487939)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/lib/Mail/mimePart.php

    r4295 r5033  
    132132    var $_eol = "\r\n"; 
    133133 
     134 
    134135    /** 
    135136    * Constructor. 
     
    801802        // Structured header (make sure addr-spec inside is not encoded) 
    802803        if (!empty($separator)) { 
     804            // Simple e-mail address regexp 
     805            $email_regexp = '(\S+|("\s*(?:[^"\f\n\r\t\v\b\s]+\s*)+"))@\S+'; 
     806 
    803807            $parts = Mail_mimePart::_explodeQuotedString($separator, $value); 
    804808            $value = ''; 
     
    818822 
    819823                // let's find phrase (name) and/or addr-spec 
    820                 if (preg_match('/^<\S+@\S+>$/', $part)) { 
     824                if (preg_match('/^<' . $email_regexp . '>$/', $part)) { 
    821825                    $value .= $part; 
    822                 } else if (preg_match('/^\S+@\S+$/', $part)) { 
     826                } else if (preg_match('/^' . $email_regexp . '$/', $part)) { 
    823827                    // address without brackets and without name 
    824828                    $value .= $part; 
    825                 } else if (preg_match('/<*\S+@\S+>*$/', $part, $matches)) { 
     829                } else if (preg_match('/<*' . $email_regexp . '>*$/', $part, $matches)) { 
    826830                    // address with name (handle name) 
    827831                    $address = $matches[0]; 
Note: See TracChangeset for help on using the changeset viewer.