From 4a4827c8ae9c1c04826ba1919d3943c696cfcad3 Mon Sep 17 00:00:00 2001 From: hetao Date: Fri, 1 Jun 2018 14:59:44 +0800 Subject: [PATCH] fix each to foreach on php7.2 --- plugins/mail/class.phpmailer.php | 2 +- plugins/mail/class.smtp.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/mail/class.phpmailer.php b/plugins/mail/class.phpmailer.php index b9a2661f..cd20c04d 100644 --- a/plugins/mail/class.phpmailer.php +++ b/plugins/mail/class.phpmailer.php @@ -1390,7 +1390,7 @@ public function EncodeQP( $input = '', $line_max = 76, $space_conv = false ) { $eol = "\r\n"; $escape = '='; $output = ''; - while( list(, $line) = each($lines) ) { + foreach($lines as $line){ $linlen = strlen($line); $newline = ''; for($i = 0; $i < $linlen; $i++) { diff --git a/plugins/mail/class.smtp.php b/plugins/mail/class.smtp.php index 3eb91469..c7d793e1 100644 --- a/plugins/mail/class.smtp.php +++ b/plugins/mail/class.smtp.php @@ -388,7 +388,7 @@ public function Data($msg_data) { $max_line_length = 998; // used below; set here for ease in change - while(list(,$line) = @each($lines)) { + foreach($lines as $line){ $lines_out = null; if($line == "" && $in_headers) { $in_headers = false; @@ -418,7 +418,7 @@ public function Data($msg_data) { $lines_out[] = $line; // now send the lines to the server - while(list(,$line_out) = @each($lines_out)) { + foreach($lines_out as $line_out){ if(strlen($line_out) > 0) { if(substr($line_out, 0, 1) == ".") { @@ -502,7 +502,7 @@ public function Expand($name) { // parse the reply and place in our array to return to user $entries = explode($this->CRLF,$rply); - while(list(,$l) = @each($entries)) { + foreach($entries as $l){ $list[] = substr($l,4); }