Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/mbstring/mbstring.c
Original file line number Diff line number Diff line change
Expand Up @@ -6395,7 +6395,7 @@ static zend_string* mb_mime_header_decode(zend_string *input, const mbfl_encodin
p = temp;
/* Decoding of MIME encoded word was successful;
* Try to collapse a run of whitespace */
if (p < e && (*p == '\n' || *p == '\r')) {
if (p < e && (*p == '\n' || *p == '\r' || *p == ' ')) {
do {
p++;
} while (p < e && (*p == '\n' || *p == '\r' || *p == '\t' || *p == ' '));
Expand Down
12 changes: 12 additions & 0 deletions ext/mbstring/tests/gh20674.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--TEST--
GH-20674 (mb_decode_mimeheader does not handle separator)
--EXTENSIONS--
mbstring
--FILE--
<?php

$subject = '=?us-ascii?Q?The_PH?= =?us-ascii?Q?P_8.5?=';
var_dump(mb_decode_mimeheader($subject));
?>
--EXPECTF--
string(11) "The PHP 8.5"
Loading