From 391f80d480a6b6ffd7198021efda17470185890e Mon Sep 17 00:00:00 2001 From: rxu Date: Sat, 30 Oct 2021 00:33:10 +0700 Subject: [PATCH] [ticket/16900] Fix quoted_printable_encode() behavior PHPBB3-16900 --- phpBB/includes/functions_messenger.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index d3228fd659..b7f3eeda36 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -1868,7 +1868,8 @@ function mail_encode($str, $eol = "\r\n") $split_length = $split_length - $split_length % 4; // Use the Quoted-Printable encoding for ASCII strings to avoid unnecessary encoding in Base64 - $encoded_str = $is_ascii ? quoted_printable_encode($str) : base64_encode($str); + // quoted_printable_encode() splits lines at length of 75 characters with =\r\n delimiter, amend this feature + $encoded_str = $is_ascii ? str_replace("=\r\n", '', quoted_printable_encode($str)) : base64_encode($str); // If encoded string meets the limits, we just return with the correct data. if (strlen($encoded_str) <= $split_length)