Ignore:
Timestamp:
2011/01/17 14:46:37 (13 years ago)
Author:
Seasoft
Message:

#403(インクルードしているライブラリ群をバージョンアップする)

  • PEAR::Mail 1.2.0
  • PEAR::Net_SMTP 1.4.4
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/module/Mail/mail.php

    r16503 r19942  
    11<?php 
    2 // 
    3 // +----------------------------------------------------------------------+ 
    4 // | PHP Version 4                                                        | 
    5 // +----------------------------------------------------------------------+ 
    6 // | Copyright (c) 1997-2003 The PHP Group                                | 
    7 // +----------------------------------------------------------------------+ 
    8 // | This source file is subject to version 2.02 of the PHP license,      | 
    9 // | that is bundled with this package in the file LICENSE, and is        | 
    10 // | available at through the world-wide-web at                           | 
    11 // | http://www.php.net/license/2_02.txt.                                 | 
    12 // | If you did not receive a copy of the PHP license and are unable to   | 
    13 // | obtain it through the world-wide-web, please send a note to          | 
    14 // | license@php.net so we can mail you a copy immediately.               | 
    15 // +----------------------------------------------------------------------+ 
    16 // | Author: Chuck Hagenbuch <chuck@horde.org>                            | 
    17 // +----------------------------------------------------------------------+ 
    18 // 
    19 // $Id$ 
     2/** 
     3 * internal PHP-mail() implementation of the PEAR Mail:: interface. 
     4 * 
     5 * PHP versions 4 and 5 
     6 * 
     7 * LICENSE: 
     8 * 
     9 * Copyright (c) 2010 Chuck Hagenbuch 
     10 * All rights reserved. 
     11 * 
     12 * Redistribution and use in source and binary forms, with or without 
     13 * modification, are permitted provided that the following conditions 
     14 * are met: 
     15 * 
     16 * o Redistributions of source code must retain the above copyright 
     17 *   notice, this list of conditions and the following disclaimer. 
     18 * o Redistributions in binary form must reproduce the above copyright 
     19 *   notice, this list of conditions and the following disclaimer in the 
     20 *   documentation and/or other materials provided with the distribution. 
     21 * o The names of the authors may not be used to endorse or promote 
     22 *   products derived from this software without specific prior written 
     23 *   permission. 
     24 * 
     25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
     26 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
     27 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
     28 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
     29 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
     30 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
     31 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
     32 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
     33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
     34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
     35 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
     36 * 
     37 * @category    Mail 
     38 * @package     Mail 
     39 * @author      Chuck Hagenbuch <chuck@horde.org>  
     40 * @copyright   2010 Chuck Hagenbuch 
     41 * @license     http://opensource.org/licenses/bsd-license.php New BSD License 
     42 * @version     CVS: $Id$ 
     43 * @link        http://pear.php.net/package/Mail/ 
     44 */ 
    2045 
    2146/** 
     
    4267    function Mail_mail($params = null) 
    4368    { 
    44         /* The other mail implementations accept parameters as arrays. 
    45          * In the interest of being consistent, explode an array into 
    46          * a string of parameter arguments. */ 
     69        // The other mail implementations accept parameters as arrays. 
     70        // In the interest of being consistent, explode an array into 
     71        // a string of parameter arguments. 
    4772        if (is_array($params)) { 
    4873            $this->_params = join(' ', $params); 
     
    6287    } 
    6388 
    64     /** 
     89    /** 
    6590     * Implements Mail_mail::send() function using php's built-in mail() 
    6691     * command. 
     
    90115    function send($recipients, $headers, $body) 
    91116    { 
    92         $this->_sanitizeHeaders($headers); 
     117        if (!is_array($headers)) { 
     118            return PEAR::raiseError('$headers must be an array'); 
     119        } 
     120 
     121        $result = $this->_sanitizeHeaders($headers); 
     122        if (is_a($result, 'PEAR_Error')) { 
     123            return $result; 
     124        } 
    93125 
    94126        // If we're passed an array of recipients, implode it. 
     
    105137        } 
    106138 
    107         /* 
    108          * Also remove the To: header.  The mail() function will add its own 
    109          * To: header based on the contents of $recipients. 
    110          */ 
     139        // Also remove the To: header.  The mail() function will add its own 
     140        // To: header based on the contents of $recipients. 
    111141        unset($headers['To']); 
    112142 
    113143        // Flatten the headers out. 
    114144        $headerElements = $this->prepareHeaders($headers); 
    115         if (PEAR::isError($headerElements)) { 
     145        if (is_a($headerElements, 'PEAR_Error')) { 
    116146            return $headerElements; 
    117147        } 
    118148        list(, $text_headers) = $headerElements; 
    119149 
    120         /* 
    121          * We only use mail()'s optional fifth parameter if the additional 
    122          * parameters have been provided and we're not running in safe mode. 
    123          */ 
     150        // We only use mail()'s optional fifth parameter if the additional 
     151        // parameters have been provided and we're not running in safe mode. 
    124152        if (empty($this->_params) || ini_get('safe_mode')) { 
    125153            $result = mail($recipients, $subject, $body, $text_headers); 
     
    129157        } 
    130158 
    131         /* 
    132          * If the mail() function returned failure, we need to create a 
    133          * PEAR_Error object and return it instead of the boolean result. 
    134          */ 
     159        // If the mail() function returned failure, we need to create a 
     160        // PEAR_Error object and return it instead of the boolean result. 
    135161        if ($result === false) { 
    136162            $result = PEAR::raiseError('mail() returned failure'); 
Note: See TracChangeset for help on using the changeset viewer.