cvs: pear /Mail package.xml /Mail/Mail smtp.php
[email protected] ("Chuck Hagenbuch")
| Newsgroups | php.pear.cvs |
|---|---|
| Message-ID | <cvschagenbu1209100403@cvsserver> |
chagenbu Fri Apr 25 05:13:23 2008 UTC
Modified files:
/pear/Mail package.xml
/pear/Mail/Mail smtp.php
Log:
getSMTPObject fixes (http://pear.php.net/bugs/bug.php?id=13772&edit=1)
http://cvs.php.net/viewvc.cgi/pear/Mail/package.xml?r1=1.60&r2=1.61&diff_format=u
Index: pear/Mail/package.xml
diff -u pear/Mail/package.xml:1.60 pear/Mail/package.xml:1.61
--- pear/Mail/package.xml:1.60 Thu Apr 24 21:43:40 2008
+++ pear/Mail/package.xml Fri Apr 25 05:13:23 2008
@@ -20,10 +20,10 @@
<email>[email protected]</email>
<active>yes</active>
</developer>
- <date>2008-04-24</date>
+ <date>2008-04-25</date>
<time>22:36:00</time>
<version>
- <release>1.2.0a1</release>
+ <release>1.2.0a2</release>
<api>1.2.0</api>
</version>
<stability>
@@ -31,8 +31,7 @@
<api>alpha</api>
</stability>
<license>PHP/BSD</license>
- <notes>- Add addServiceExtensionParameter() to the SMTP driver ([email protected], Bug #13764).
-- Add a method to obtain the Net_SMTP object from the SMTP driver ([email protected], Bug #13766).
+ <notes>- Make sure Net_SMTP is defined when calling getSMTPObject() directly ([email protected], Bug #13772).
</notes>
<contents>
<dir name="/">
http://cvs.php.net/viewvc.cgi/pear/Mail/Mail/smtp.php?r1=1.32&r2=1.33&diff_format=u
Index: pear/Mail/Mail/smtp.php
diff -u pear/Mail/Mail/smtp.php:1.32 pear/Mail/Mail/smtp.php:1.33
--- pear/Mail/Mail/smtp.php:1.32 Thu Apr 24 21:43:40 2008
+++ pear/Mail/Mail/smtp.php Fri Apr 25 05:13:23 2008
@@ -42,7 +42,7 @@
* SMTP implementation of the PEAR Mail interface. Requires the Net_SMTP class.
* @access public
* @package Mail
- * @version $Revision: 1.32 $
+ * @version $Revision: 1.33 $
*/
class Mail_smtp extends Mail {
@@ -217,8 +217,6 @@
*/
function send($recipients, $headers, $body)
{
- include_once 'Net/SMTP.php';
-
/* If we don't already have an SMTP object, create one. */
$result = &$this->getSMTPObject();
if (PEAR::isError($result)) {
@@ -229,10 +227,7 @@
return PEAR::raiseError('$headers must be an array');
}
- $result = $this->_sanitizeHeaders($headers);
- if (is_a($result, 'PEAR_Error')) {
- return $result;
- }
+ $this->_sanitizeHeaders($headers);
$headerElements = $this->prepareHeaders($headers);
if (is_a($headerElements, 'PEAR_Error')) {
@@ -260,7 +255,7 @@
$params .= ' ' . $key . (is_null($val) ? '' : '=' . $val);
}
}
- if (PEAR::isError($res = $this->_smtp->mailFrom($from, $params))) {
+ if (PEAR::isError($res = $this->_smtp->mailFrom($from, ltrim($params)))) {
$error = $this->_error("Failed to set sender: $from", $res);
$this->_smtp->rset();
return PEAR::raiseError($error, PEAR_MAIL_SMTP_ERROR_SENDER);
@@ -313,6 +308,7 @@
return $this->_smtp;
}
+ include_once 'Net/SMTP.php';
$this->_smtp = &new Net_SMTP($this->host,
$this->port,
$this->localhost);