From 0802772f09667f80d8987b1788cea209058e3431 Mon Sep 17 00:00:00 2001 From: Christian Schnegelberger Date: Sun, 6 Nov 2022 17:27:08 +0100 Subject: [PATCH 1/3] [ticket/17058] Add if-sentence for $encode_eol for email headers PHPBB3-17058 --- phpBB/includes/functions_messenger.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 749a8798e3..894f2cf2e7 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -597,7 +597,7 @@ class messenger $this->from = $board_contact; } - $encode_eol = ($config['smtp_delivery']) ? "\r\n" : PHP_EOL; + $encode_eol = $config['smtp_delivery'] || PHP_VERSION_ID >= 80000 ? "\r\n" : PHP_EOL; // Build to, cc and bcc strings $to = $cc = $bcc = ''; From 6f034c52153adc30737ff140105d92c41948e771 Mon Sep 17 00:00:00 2001 From: Christian Schnegelberger Date: Sun, 6 Nov 2022 18:33:12 +0100 Subject: [PATCH 2/3] [ticket/17058] Replace hardcoded PHP_EOL in phpbb_mail() with var PHPBB3-17058 --- phpBB/includes/functions_messenger.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 894f2cf2e7..619907fe2b 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -629,7 +629,7 @@ class messenger } else { - $result = phpbb_mail($mail_to, $this->subject, $this->msg, $headers, PHP_EOL, $err_msg); + $result = phpbb_mail($mail_to, $this->subject, $this->msg, $headers, $encode_eol, $err_msg); } if (!$result) @@ -952,7 +952,7 @@ class queue } else { - $result = phpbb_mail($to, $subject, $msg, $headers, PHP_EOL, $err_msg); + $result = phpbb_mail($to, $subject, $msg, $headers, $encode_eol, $err_msg); } if (!$result) From 9fb2dbb776294d414cc2db7f148c0bab61ceebbf Mon Sep 17 00:00:00 2001 From: Christian Schnegelberger Date: Sun, 6 Nov 2022 21:15:45 +0100 Subject: [PATCH 3/3] [ticket/17058] Add $encode_eol to process() PHPBB3-17058 --- phpBB/includes/functions_messenger.php | 1 + 1 file changed, 1 insertion(+) diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 619907fe2b..27865cbe54 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -952,6 +952,7 @@ class queue } else { + $encode_eol = $config['smtp_delivery'] || PHP_VERSION_ID >= 80000 ? "\r\n" : PHP_EOL; $result = phpbb_mail($to, $subject, $msg, $headers, $encode_eol, $err_msg); }