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)
962
962
if (!$ coding && $ char === 61 && preg_match ('/;(\s+)?([a-z0-9\-]+)(\s+)?(=(\s+)?\"[^\"]+)?/ui ' , $ result )) {
963
963
$ ascii = true ;
964
964
}
965
+ if ($ coding && $ symbol === ' ' ) {
966
+ $ ascii = false ;
967
+ }
965
968
if ($ ascii ) {
966
969
if ($ coding ) {
967
970
$ coding = false ;
@@ -981,8 +984,13 @@ private function encodeHeader($header, $value)
981
984
$ add += 3 ;
982
985
}
983
986
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
+ }
986
994
}
987
995
$ result .= $ line ;
988
996
$ position += $ add ;
You can’t perform that action at this time.
0 commit comments