diff --git a/class.phpmailer.php b/class.phpmailer.php index c86cfe87f..7c73d3f92 100644 --- a/class.phpmailer.php +++ b/class.phpmailer.php @@ -585,7 +585,8 @@ public function __construct($exceptions = false) */ public function __destruct() { - if ($this->Mailer == 'smtp') { //close any open SMTP connection nicely + //Close any open SMTP connection nicely + if ($this->Mailer == 'smtp') { $this->smtpClose(); } } @@ -1262,7 +1263,8 @@ protected function smtpSend($header, $body) $this->smtp->quit(); $this->smtp->close(); } - if (count($bad_rcpt) > 0) { // Create error message for any bad addresses + //Create error message for any bad addresses + if (count($bad_rcpt) > 0) { throw new phpmailerException( $this->lang('recipients_failed') . implode(', ', $bad_rcpt), self::STOP_CONTINUE @@ -2339,7 +2341,8 @@ public function encodeHeader($str, $position = 'text') break; } - if ($matchcount == 0) { // There are no chars that need encoding + //There are no chars that need encoding + if ($matchcount == 0) { return ($str); } diff --git a/class.smtp.php b/class.smtp.php index d6991970f..b4ab079ab 100644 --- a/class.smtp.php +++ b/class.smtp.php @@ -309,7 +309,8 @@ public function connect($host, $port = null, $timeout = 30, $options = array()) // Windows does not have support for this timeout function if (substr(PHP_OS, 0, 3) != 'WIN') { $max = ini_get('max_execution_time'); - if ($max != 0 && $timeout > $max) { // Don't bother if unlimited + // Don't bother if unlimited + if ($max != 0 && $timeout > $max) { @set_time_limit($timeout); } stream_set_timeout($this->smtp_conn, $timeout, 0); @@ -632,7 +633,8 @@ public function data($msg_data) //Working backwards, try to find a space within the last MAX_LINE_LENGTH chars of the line to break on //so as to avoid breaking in the middle of a word $pos = strrpos(substr($line, 0, self::MAX_LINE_LENGTH), ' '); - if (!$pos) { //Deliberately matches both false and 0 + //Deliberately matches both false and 0 + if (!$pos) { //No nice break found, add a hard break $pos = self::MAX_LINE_LENGTH - 1; $lines_out[] = substr($line, 0, $pos); @@ -838,7 +840,8 @@ protected function sendCommand($command, $commandstring, $expect) '', $this->last_reply ); - } else { // Fall back to simple parsing if regex fails + } else { + // Fall back to simple parsing if regex fails $code = substr($this->last_reply, 0, 3); $code_ex = null; $detail = substr($this->last_reply, 4);