mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.4' into PHP-8.5
This commit is contained in:
4
NEWS
4
NEWS
@@ -17,6 +17,10 @@ PHP NEWS
|
||||
. Fixed bug GH-20668 (\Uri\WhatWg\Url::withHost() crashes (SEGV) for URLs
|
||||
using the file: scheme). (lexborisov)
|
||||
|
||||
- Mbstring
|
||||
. Fixed bug GH-20674 (Fix GH-20674 mb_decode_mimeheader does not handle
|
||||
separator). (Yuya Hamada)
|
||||
|
||||
- Sqlite3:
|
||||
. Fixed bug GH-20699 (SQLite3Result fetchArray return array|false,
|
||||
null returned). (ndossche, plusminmax)
|
||||
|
||||
@@ -6667,13 +6667,15 @@ 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 == '\t' || *p == ' ')) {
|
||||
do {
|
||||
p++;
|
||||
} while (p < e && (*p == '\n' || *p == '\r' || *p == '\t' || *p == ' '));
|
||||
/* We will only actually output a space if this is not immediately followed
|
||||
* by another valid encoded word */
|
||||
space_pending = true;
|
||||
} else {
|
||||
space_pending = false;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
40
ext/mbstring/tests/gh20674.phpt
Normal file
40
ext/mbstring/tests/gh20674.phpt
Normal file
@@ -0,0 +1,40 @@
|
||||
--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));
|
||||
|
||||
// mb_decode_mimeheader's backward compatible for TAB(\t)
|
||||
$subject = "=?us-ascii?Q?The_PH?=\t=?us-ascii?Q?P_8.5?=";
|
||||
var_dump(mb_decode_mimeheader($subject));
|
||||
|
||||
$subject = "=?us-ascii?Q?The_PH?=\t =?us-ascii?Q?P_8.5?=";
|
||||
var_dump(mb_decode_mimeheader($subject));
|
||||
|
||||
$subject = "=?us-ascii?Q?The_PH?= \t =?us-ascii?Q?P_8.5?=";
|
||||
var_dump(mb_decode_mimeheader($subject));
|
||||
|
||||
// from RFC 2047 https://www.ietf.org/rfc/rfc2047#section-8
|
||||
var_dump(mb_decode_mimeheader("(=?ISO-8859-1?Q?a?=)"));
|
||||
var_dump(mb_decode_mimeheader("(=?ISO-8859-1?Q?a?= b)"));
|
||||
var_dump(mb_decode_mimeheader("(=?ISO-8859-1?Q?a_b?=)"));
|
||||
var_dump(mb_decode_mimeheader("(=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=)"));
|
||||
var_dump(mb_decode_mimeheader("(=?ISO-8859-1?Q?a?= =?ISO-8859-1?Q?b?=)"));
|
||||
var_dump(mb_decode_mimeheader("(=?ISO-8859-1?Q?a?=
|
||||
=?ISO-8859-1?Q?b?=)"));
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(11) "The PHP 8.5"
|
||||
string(11) "The PHP 8.5"
|
||||
string(11) "The PHP 8.5"
|
||||
string(11) "The PHP 8.5"
|
||||
string(3) "(a)"
|
||||
string(5) "(a b)"
|
||||
string(5) "(a b)"
|
||||
string(4) "(ab)"
|
||||
string(4) "(ab)"
|
||||
string(4) "(ab)"
|
||||
Reference in New Issue
Block a user