1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-14 04:30:29 +01:00

[ticket/16900] Fix quoted_printable_encode() behavior

PHPBB3-16900
This commit is contained in:
rxu 2021-10-30 00:33:10 +07:00
parent dd029ed592
commit 391f80d480
No known key found for this signature in database
GPG Key ID: 955F0567380E586A

View File

@ -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)