Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ PHP NEWS
deeply nested arrays. (Eyüp Can Akman)
. Fixed the JIT freeing the string returned by mb_encode_mimeheader() or
mb_output_handler() while it is still in use. (Ilia Alshanetsky)
. Fixed bug GH-25832 (mb_encode_mimeheader() rejects null for $charset and
$transfer_encoding). (Tomasz Kowalczyk)

- MySQLi:
. Fixed bug GH-25779 (mysqli_fetch_object() crashes with JIT when the
Expand Down
4 changes: 2 additions & 2 deletions ext/mbstring/mbstring.c
Original file line number Diff line number Diff line change
Expand Up @@ -6604,8 +6604,8 @@ PHP_FUNCTION(mb_encode_mimeheader)
ZEND_PARSE_PARAMETERS_START(1, 5)
Z_PARAM_STR(str)
Z_PARAM_OPTIONAL
Z_PARAM_STR(charset_name)
Z_PARAM_STR(transenc_name)
Z_PARAM_STR_OR_NULL(charset_name)
Z_PARAM_STR_OR_NULL(transenc_name)
Z_PARAM_STRING(linefeed, linefeed_len)
Z_PARAM_LONG(indent)
ZEND_PARSE_PARAMETERS_END();
Expand Down
19 changes: 19 additions & 0 deletions ext/mbstring/tests/gh25832.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--TEST--
GH-25832: mb_encode_mimeheader() rejects null for $charset and $transfer_encoding
--EXTENSIONS--
mbstring
--FILE--
<?php
mb_internal_encoding('UTF-8');
mb_language('neutral');
var_dump(mb_encode_mimeheader('abc é', null));
var_dump(mb_encode_mimeheader('abc é', null, null));
var_dump(mb_encode_mimeheader('abc é', 'UTF-8', null));
mb_language('English');
var_dump(mb_encode_mimeheader('abc é', null, null));
?>
--EXPECT--
string(20) "abc =?UTF-8?B?w6k=?="
string(20) "abc =?UTF-8?B?w6k=?="
string(20) "abc =?UTF-8?B?w6k=?="
string(24) "abc =?ISO-8859-1?Q?=E9?="
Loading