1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 16:22:43 +01:00

PHPMailer: Remove use of each() function removed in PHP 8.0

Summary:
`each()` has been deprecated since PHP 7.2 and got removed in PHP 8.0 per https://www.php.net/manual/en/function.each.php

Replace it with a `foreach` construction.

Closes T15833

Test Plan: Carefully read the code; locally testing that construction per D25659#18155; compare to similar rP9623e667458821f696eb92e9dac5a2c9720af7af

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15833

Differential Revision: https://we.phorge.it/D25659
This commit is contained in:
Andre Klapper 2024-05-17 15:56:06 +02:00
parent 601ac45032
commit a579a974eb
2 changed files with 4 additions and 4 deletions

View file

@ -1487,7 +1487,7 @@ class PHPMailerLite {
$eol = "\r\n";
$escape = '=';
$output = '';
while( list(, $line) = each($lines) ) {
foreach ($lines as $line) {
$linlen = strlen($line);
$newline = '';
for($i = 0; $i < $linlen; $i++) {
@ -1518,7 +1518,7 @@ class PHPMailerLite {
$newline .= $c;
} // end of for
$output .= $newline.$eol;
} // end of while
} // end of foreach
return $output;
}

View file

@ -1619,7 +1619,7 @@ class PHPMailer {
$eol = "\r\n";
$escape = '=';
$output = '';
while( list(, $line) = each($lines) ) {
foreach ($lines as $line) {
$linlen = strlen($line);
$newline = '';
for($i = 0; $i < $linlen; $i++) {
@ -1650,7 +1650,7 @@ class PHPMailer {
$newline .= $c;
} // end of for
$output .= $newline.$eol;
} // end of while
} // end of foreach
return $output;
}