diff options
Diffstat (limited to 'phpBB/includes/functions_messenger.php')
| -rw-r--r-- | phpBB/includes/functions_messenger.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 866acc7f1a..aad064d5e6 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -1446,9 +1446,10 @@ function mail_encode($str) // define start delimimter, end delimiter and spacer $start = "=?UTF-8?B?"; $end = "?="; - $spacer = $end . ' ' . $start; - $split_length = 64; + $delimiter = "\r\n "; + // Maximum length is 75 for everything. 75 - length of start/end/delimiter == 63 + $split_length = 63; $encoded_str = base64_encode($str); // If encoded string meets the limits, we just return with the correct data. @@ -1460,7 +1461,7 @@ function mail_encode($str) // If there is only ASCII data, we just return what we want, correctly splitting the lines. if (strlen($str) === utf8_strlen($str)) { - return $start . implode($spacer, str_split($encoded_str, $split_length)) . $end; + return $start . implode($end . $delimiter . $start, str_split($encoded_str, $split_length)) . $end; } // UTF-8 data, compose encoded lines @@ -1476,10 +1477,10 @@ function mail_encode($str) $text .= array_shift($array); } - $str .= $start . base64_encode($text) . $end . ' '; + $str .= $start . base64_encode($text) . $end . $delimiter; } - return substr($str, 0, -1); + return substr($str, 0, -strlen($delimiter)); } ?>
\ No newline at end of file |
