web/lib/Zend/Mime.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_Mime
    16  * @package    Zend_Mime
    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: Mime.php 20096 2010-01-06 02:05:09Z bkarwin $
    19  * @version    $Id: Mime.php 24953 2012-06-13 19:09:58Z rob $
    20  */
    20  */
    21 
    21 
    22 
    22 
    23 /**
    23 /**
    24  * Support class for MultiPart Mime Messages
    24  * Support class for MultiPart Mime Messages
    25  *
    25  *
    26  * @category   Zend
    26  * @category   Zend
    27  * @package    Zend_Mime
    27  * @package    Zend_Mime
    28  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
    28  * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
    29  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    29  * @license    http://framework.zend.com/license/new-bsd     New BSD License
    30  */
    30  */
    31 class Zend_Mime
    31 class Zend_Mime
    32 {
    32 {
    33     const TYPE_OCTETSTREAM = 'application/octet-stream';
    33     const TYPE_OCTETSTREAM = 'application/octet-stream';
   128     {
   128     {
   129         $out = '';
   129         $out = '';
   130         $str = self::_encodeQuotedPrintable($str);
   130         $str = self::_encodeQuotedPrintable($str);
   131 
   131 
   132         // Split encoded text into separate lines
   132         // Split encoded text into separate lines
   133         while ($str) {
   133         while(strlen($str) > 0) {
   134             $ptr = strlen($str);
   134             $ptr = strlen($str);
   135             if ($ptr > $lineLength) {
   135             if ($ptr > $lineLength) {
   136                 $ptr = $lineLength;
   136                 $ptr = $lineLength;
   137             }
   137             }
   138 
   138 
   192         $lineLength = $lineLength-strlen($prefix)-3;
   192         $lineLength = $lineLength-strlen($prefix)-3;
   193 
   193 
   194         $str = self::_encodeQuotedPrintable($str);
   194         $str = self::_encodeQuotedPrintable($str);
   195 
   195 
   196         // Mail-Header required chars have to be encoded also:
   196         // Mail-Header required chars have to be encoded also:
   197         $str = str_replace(array('?', ' ', '_'), array('=3F', '=20', '=5F'), $str);
   197         $str = str_replace(array('?', ' ', '_', ','), array('=3F', '=20', '=5F', '=2C'), $str);
   198 
   198 
   199         // initialize first line, we need it anyways
   199         // initialize first line, we need it anyways
   200         $lines = array(0 => "");
   200         $lines = array(0 => "");
   201 
   201 
   202         // Split encoded text into separate lines
   202         // Split encoded text into separate lines