web/lib/Zend/Mail.php
changeset 807 877f952ae2bd
parent 207 621fa6caec0c
child 1230 68c69c656a2c
equal deleted inserted replaced
805:5e7a0fedabdf 807:877f952ae2bd
    12  * obtain it through the world-wide-web, please send an email
    12  * obtain it through the world-wide-web, please send an email
    13  * to license@zend.com so we can send you a copy immediately.
    13  * to license@zend.com so we can send you a copy immediately.
    14  *
    14  *
    15  * @category   Zend
    15  * @category   Zend
    16  * @package    Zend_Mail
    16  * @package    Zend_Mail
    17  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    17  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    18  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    18  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    19  * @version    $Id: Mail.php 23251 2010-10-26 12:47:55Z matthew $
    19  * @version    $Id: Mail.php 24593 2012-01-05 20:35:02Z matthew $
    20  */
    20  */
    21 
    21 
    22 
    22 
    23 /**
    23 /**
    24  * @see Zend_Mail_Transport_Abstract
    24  * @see Zend_Mail_Transport_Abstract
    44 /**
    44 /**
    45  * Class for sending an email.
    45  * Class for sending an email.
    46  *
    46  *
    47  * @category   Zend
    47  * @category   Zend
    48  * @package    Zend_Mail
    48  * @package    Zend_Mail
    49  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    49  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    50  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    50  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    51  */
    51  */
    52 class Zend_Mail extends Zend_Mime_Message
    52 class Zend_Mail extends Zend_Mime_Message
    53 {
    53 {
    54     /**#@+
    54     /**#@+
  1262     {
  1262     {
  1263         if ($name === '' || $name === null || $name === $email) {
  1263         if ($name === '' || $name === null || $name === $email) {
  1264             return $email;
  1264             return $email;
  1265         } else {
  1265         } else {
  1266             $encodedName = $this->_encodeHeader($name);
  1266             $encodedName = $this->_encodeHeader($name);
  1267             if ($encodedName === $name &&
  1267             if ($encodedName === $name  &&  strcspn($name, '()<>[]:;@\\,') != strlen($name)) {
  1268                     ((strpos($name, '@') !== false) || (strpos($name, ',') !== false))) {
       
  1269                 $format = '"%s" <%s>';
  1268                 $format = '"%s" <%s>';
  1270             } else {
  1269             } else {
  1271                 $format = '%s <%s>';
  1270                 $format = '%s <%s>';
  1272             }
  1271             }
  1273             return sprintf($format, $encodedName, $email);
  1272             return sprintf($format, $encodedName, $email);