From a44e6913324bd47e17bfd4109fc65b699c508006 Mon Sep 17 00:00:00 2001 From: nisheeth-barthwal Date: Mon, 18 Feb 2013 18:07:03 +0530 Subject: Removed the unused $force paramter in Email::_smtp_connect() --- system/libraries/Email.php | 58 +++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'system/libraries/Email.php') diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 91c119e02..1bf1da15e 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -1863,47 +1863,47 @@ class CI_Email { /** * SMTP Connect * - * @param bool * @return string */ - protected function _smtp_connect($force=FALSE) + protected function _smtp_connect() { - if ( ! is_resource($this->_smtp_connect) OR $force) + if (is_resource($this->_smtp_connect)) { - $ssl = ($this->smtp_crypto === 'ssl') ? 'ssl://' : NULL; + return TRUE; + } - $this->_smtp_connect = fsockopen($ssl.$this->smtp_host, - $this->smtp_port, - $errno, - $errstr, - $this->smtp_timeout); + $ssl = ($this->smtp_crypto === 'ssl') ? 'ssl://' : NULL; - if ( ! is_resource($this->_smtp_connect)) - { - $this->_set_error_message('lang:email_smtp_error', $errno.' '.$errstr); - return FALSE; - } + $this->_smtp_connect = fsockopen($ssl.$this->smtp_host, + $this->smtp_port, + $errno, + $errstr, + $this->smtp_timeout); - stream_set_timeout($this->_smtp_connect, $this->smtp_timeout); - $this->_set_error_message($this->_get_smtp_data()); + if ( ! is_resource($this->_smtp_connect)) + { + $this->_set_error_message('lang:email_smtp_error', $errno.' '.$errstr); + return FALSE; + } - if ($this->smtp_crypto === 'tls') - { - $this->_send_command('hello'); - $this->_send_command('starttls'); + stream_set_timeout($this->_smtp_connect, $this->smtp_timeout); + $this->_set_error_message($this->_get_smtp_data()); - $crypto = stream_socket_enable_crypto($this->_smtp_connect, TRUE, STREAM_CRYPTO_METHOD_TLS_CLIENT); + if ($this->smtp_crypto === 'tls') + { + $this->_send_command('hello'); + $this->_send_command('starttls'); - if ($crypto !== TRUE) - { - $this->_set_error_message('lang:email_smtp_error', $this->_get_smtp_data()); - return FALSE; - } - } + $crypto = stream_socket_enable_crypto($this->_smtp_connect, TRUE, STREAM_CRYPTO_METHOD_TLS_CLIENT); - return $this->_send_command('hello'); + if ($crypto !== TRUE) + { + $this->_set_error_message('lang:email_smtp_error', $this->_get_smtp_data()); + return FALSE; + } } - return TRUE; + + return $this->_send_command('hello'); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b