Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e59fb22

Browse files
committed
fix headers encoding
1 parent db6d1f2 commit e59fb22

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

‎src/Message.php‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,9 @@ private function encodeHeader($header, $value)
962962
if (!$coding && $char === 61 && preg_match('/;(\s+)?([a-z0-9\-]+)(\s+)?(=(\s+)?\"[^\"]+)?/ui', $result)) {
963963
$ascii = true;
964964
}
965+
if ($coding && $symbol === '') {
966+
$ascii = false;
967+
}
965968
if ($ascii) {
966969
if ($coding) {
967970
$coding = false;
@@ -981,8 +984,13 @@ private function encodeHeader($header, $value)
981984
$add += 3;
982985
}
983986
if ($position + $add >= $max) {
984-
$line = "=\r\n$line";
985-
$position = $add + 1;
987+
if ($coding) {
988+
$line = "?=\r\n =?utf-8?Q?$line";
989+
$position = $add + 11;
990+
} else {
991+
$line = "=\r\n$line";
992+
$position = $add + 1;
993+
}
986994
}
987995
$result .= $line;
988996
$position += $add;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /