Skip to content

Commit 4a4827c

Browse files
author
hetao
committed
fix each to foreach on php7.2
1 parent d1a92dc commit 4a4827c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

plugins/mail/class.phpmailer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1390,7 +1390,7 @@ public function EncodeQP( $input = '', $line_max = 76, $space_conv = false ) {
13901390
$eol = "\r\n";
13911391
$escape = '=';
13921392
$output = '';
1393-
while( list(, $line) = each($lines) ) {
1393+
foreach($lines as $line){
13941394
$linlen = strlen($line);
13951395
$newline = '';
13961396
for($i = 0; $i < $linlen; $i++) {

plugins/mail/class.smtp.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ public function Data($msg_data) {
388388

389389
$max_line_length = 998; // used below; set here for ease in change
390390

391-
while(list(,$line) = @each($lines)) {
391+
foreach($lines as $line){
392392
$lines_out = null;
393393
if($line == "" && $in_headers) {
394394
$in_headers = false;
@@ -418,7 +418,7 @@ public function Data($msg_data) {
418418
$lines_out[] = $line;
419419

420420
// now send the lines to the server
421-
while(list(,$line_out) = @each($lines_out)) {
421+
foreach($lines_out as $line_out){
422422
if(strlen($line_out) > 0)
423423
{
424424
if(substr($line_out, 0, 1) == ".") {
@@ -502,7 +502,7 @@ public function Expand($name) {
502502

503503
// parse the reply and place in our array to return to user
504504
$entries = explode($this->CRLF,$rply);
505-
while(list(,$l) = @each($entries)) {
505+
foreach($entries as $l){
506506
$list[] = substr($l,4);
507507
}
508508

0 commit comments

Comments
 (0)