From df4462611cc71f785c4d8f05d7cebe695c12f6b9 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 1 May 2010 09:51:07 -0700 Subject: Revert "Update PEAR::Mail to 1.2.0 release; fixes deprecation warnings running under PHP 5.3." This reverts commit 9fd02a4f11881b3e0e1b3029c7c9e85a799c5ced. Looks like there's some changes I missed in there and getting this in'll involve updating some other packages. Will poke it after 0.9.2. --- extlib/Mail.php | 82 ++++++++++++++++++--------------------------------------- 1 file changed, 25 insertions(+), 57 deletions(-) mode change 100755 => 100644 extlib/Mail.php (limited to 'extlib/Mail.php') diff --git a/extlib/Mail.php b/extlib/Mail.php old mode 100755 new mode 100644 index 75132ac2a..3a0c1a9cb --- a/extlib/Mail.php +++ b/extlib/Mail.php @@ -1,47 +1,22 @@ - * @copyright 1997-2010 Chuck Hagenbuch - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Mail.php 294747 2010-02-08 08:18:33Z clockwerx $ - * @link http://pear.php.net/package/Mail/ - */ +// +// +----------------------------------------------------------------------+ +// | PHP Version 4 | +// +----------------------------------------------------------------------+ +// | Copyright (c) 1997-2003 The PHP Group | +// +----------------------------------------------------------------------+ +// | This source file is subject to version 2.02 of the PHP license, | +// | that is bundled with this package in the file LICENSE, and is | +// | available at through the world-wide-web at | +// | http://www.php.net/license/2_02.txt. | +// | If you did not receive a copy of the PHP license and are unable to | +// | obtain it through the world-wide-web, please send a note to | +// | license@php.net so we can mail you a copy immediately. | +// +----------------------------------------------------------------------+ +// | Author: Chuck Hagenbuch | +// +----------------------------------------------------------------------+ +// +// $Id: Mail.php,v 1.17 2006/09/15 03:41:18 jon Exp $ require_once 'PEAR.php'; @@ -51,7 +26,7 @@ require_once 'PEAR.php'; * useful in multiple mailer backends. * * @access public - * @version $Revision: 294747 $ + * @version $Revision: 1.17 $ * @package Mail */ class Mail @@ -107,20 +82,12 @@ class Mail * @return mixed Returns true on success, or a PEAR_Error * containing a descriptive error message on * failure. - * * @access public * @deprecated use Mail_mail::send instead */ function send($recipients, $headers, $body) { - if (!is_array($headers)) { - return PEAR::raiseError('$headers must be an array'); - } - - $result = $this->_sanitizeHeaders($headers); - if (is_a($result, 'PEAR_Error')) { - return $result; - } + $this->_sanitizeHeaders($headers); // if we're passed an array of recipients, implode it. if (is_array($recipients)) { @@ -136,9 +103,10 @@ class Mail } // flatten the headers out. - list(, $text_headers) = Mail::prepareHeaders($headers); + list(,$text_headers) = Mail::prepareHeaders($headers); return mail($recipients, $subject, $body, $text_headers); + } /** @@ -183,9 +151,9 @@ class Mail foreach ($headers as $key => $value) { if (strcasecmp($key, 'From') === 0) { include_once 'Mail/RFC822.php'; - $parser = new Mail_RFC822(); + $parser = &new Mail_RFC822(); $addresses = $parser->parseAddressList($value, 'localhost', false); - if (is_a($addresses, 'PEAR_Error')) { + if (PEAR::isError($addresses)) { return $addresses; } @@ -253,7 +221,7 @@ class Mail $addresses = Mail_RFC822::parseAddressList($recipients, 'localhost', false); // If parseAddressList() returned a PEAR_Error object, just return it. - if (is_a($addresses, 'PEAR_Error')) { + if (PEAR::isError($addresses)) { return $addresses; } -- cgit v1.2.3