File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments