cvs: pear /Net_SMTP SMTP.php
| From: | Jon Parise | Date: | Thu, 16 Jan 2003 04:58:51 +0000 |
| Subject: | cvs: pear /Net_SMTP SMTP.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-8281@lists.php.net to get a copy of this message | ||
jon Wed Jan 15 23:58:51 2003 EDT
Modified files:
/pear/Net_SMTP SMTP.php
Log:
Make $this->_auth_methods a static local variable of _getBestAuthMethod().
Index: pear/Net_SMTP/SMTP.php
diff -u pear/Net_SMTP/SMTP.php:1.25 pear/Net_SMTP/SMTP.php:1.26
--- pear/Net_SMTP/SMTP.php:1.25 Tue Jan 14 22:56:42 2003
+++ pear/Net_SMTP/SMTP.php Wed Jan 15 23:58:51 2003
@@ -81,12 +81,6 @@
var $esmtp = array();
/**
- * The list of supported authentication methods, ordered by preference.
- * @var array
- */
- var $_auth_methods = array('DIGEST-MD5', 'CRAM-MD5', 'LOGIN',
'PLAIN');
-
- /**
* Constructor
*
* Instantiates a new Net_SMTP object, overriding any defaults
@@ -340,9 +334,11 @@
*/
function _getBestAuthMethod()
{
+ static $methods = array('DIGEST-MD5', 'CRAM-MD5', 'LOGIN',
'PLAIN');
+
$available_methods = explode(' ', $this->esmtp['AUTH']);
- foreach ($this->_auth_methods as $method) {
+ foreach ($methods as $method) {
if (in_array($method, $available_methods)) {
return $method;
}
@@ -375,7 +371,7 @@
*/
if (empty($method)) {
if (PEAR::isError($method = $this->_getBestAuthMethod())) {
- /* Return the PEAR_Error object from _getBestAuthMethod() */
+ /* Return the PEAR_Error object from _getBestAuthMethod(). */
return $method;
}
} else {