[ticket/16912] Adjust code

PHPBB3-16912
This commit is contained in:
rxu 2021-12-24 20:44:15 +07:00
parent a0ced790e2
commit b305070e0a
No known key found for this signature in database
GPG key ID: 955F0567380E586A

View file

@ -1858,9 +1858,9 @@ function mail_encode($str, $eol = "\r\n")
$scheme = $is_ascii ? 'Q' : 'B'; $scheme = $is_ascii ? 'Q' : 'B';
// Define start delimimter, end delimiter // Define start delimiter, end delimiter
// Use the Quoted-Printable encoding for ASCII strings to avoid unnecessary encoding in Base64 // Use the Quoted-Printable encoding for ASCII strings to avoid unnecessary encoding in Base64
$start = $is_ascii ? '=?US-ASCII?' . $scheme . '?' : '=?UTF-8?' . $scheme . '?'; $start = '=?' . ($is_ascii ? 'US-ASCII' : 'UTF-8') . '?' . $scheme . '?';
$end = '?='; $end = '?=';
// Maximum encoded-word length is 75 as per RFC 2047 section 2. // Maximum encoded-word length is 75 as per RFC 2047 section 2.
@ -1908,7 +1908,7 @@ function mail_encode($str, $eol = "\r\n")
$is_quoted_printable && $line_length += strlen($char); $is_quoted_printable && $line_length += strlen($char);
} }
if ('' !== $line_data) if ($line_data !== '')
{ {
if (!$is_quoted_printable) if (!$is_quoted_printable)
{ {