[php-src] Issue #20674: mb_decode_mimeheader does not handle separator
| From: | ewwink | Date: | Tue, 09 Dec 2025 14:21:37 +0000 |
| Subject: | [php-src] Issue #20674: mb_decode_mimeheader does not handle separator | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-251371@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/20674
Author: ewwink
### Description
if encoded Subject are too long they need to be separated the block by space
?= =? or
line break, but mb_decode_mimeheader does not handle it correctly
The following code:
```php
<?php
$subject = '=?us-ascii?Q?The_PH?= =?us-ascii?Q?P_8.5?=';
echo mb_decode_mimeheader($subject) ;
```
PHP 8.3.21, 8.4.10 Result:
```
The PH P 8.5
```
PHP 8.0.30, 7.4.33 Result:
```
The_PHP_8.5
```
But I expected this output instead, as iconv_mime_decode does:
```
The PHP 8.5
```
### PHP Version
```plain
8.3.21, 8.4.10
```
### Operating System
Ubuntu 24.04