Changeset 5135 for trunk/library/mime/mimePart.php
- Timestamp:
- 11/03/11 13:26:45 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/library/mime/mimePart.php
r4414 r5135 49 49 * @copyright 2003-2006 PEAR <pear-group@php.net> 50 50 * @license http://www.opensource.org/licenses/bsd-license.php BSD License 51 * @version CVS: $Id: mimePart.php 3 05690 2010-11-23 12:41:00Z alec $51 * @version CVS: $Id: mimePart.php 314695 2011-08-10 07:18:07Z alec $ 52 52 * @link http://pear.php.net/package/Mail_mime 53 53 */ … … 145 145 * cid - Content ID to apply 146 146 * disposition - Content disposition, inline or attachment 147 * dfilename- Filename parameter for content disposition147 * filename - Filename parameter for content disposition 148 148 * description - Content description 149 149 * name_encoding - Encoding of the attachment name (Content-Type) … … 186 186 $this->_body_file = $value; 187 187 break; 188 189 // for backward compatibility 190 case 'dfilename': 191 $params['filename'] = $value; 192 break; 188 193 } 189 194 } … … 801 806 // Structured header (make sure addr-spec inside is not encoded) 802 807 if (!empty($separator)) { 808 // Simple e-mail address regexp 809 $email_regexp = '(\S+|("[^\r\n"]+"))@\S+'; 810 803 811 $parts = Mail_mimePart::_explodeQuotedString($separator, $value); 804 812 $value = ''; … … 818 826 819 827 // let's find phrase (name) and/or addr-spec 820 if (preg_match('/^< \S+@\S+>$/', $part)) {828 if (preg_match('/^<' . $email_regexp . '>$/', $part)) { 821 829 $value .= $part; 822 } else if (preg_match('/^ \S+@\S+$/', $part)) {830 } else if (preg_match('/^' . $email_regexp . '$/', $part)) { 823 831 // address without brackets and without name 824 832 $value .= $part; 825 } else if (preg_match('/<* \S+@\S+>*$/', $part, $matches)) {833 } else if (preg_match('/<*' . $email_regexp . '>*$/', $part, $matches)) { 826 834 // address with name (handle name) 827 835 $address = $matches[0];
Note: See TracChangeset
for help on using the changeset viewer.