mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1: Fix #76704: mb_detect_order return value varies based on argument type
This commit is contained in:
commit
db8bcdba80
3 changed files with 23 additions and 4 deletions
3
NEWS
3
NEWS
|
@ -2,6 +2,9 @@ PHP NEWS
|
|||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2018, PHP 7.2.10
|
||||
|
||||
- mbstring:
|
||||
. Fixed bug #76704 (mb_detect_order return value varies based on argument
|
||||
type). (cmb)
|
||||
|
||||
16 Aug 2018, PHP 7.2.9
|
||||
|
||||
|
|
|
@ -702,7 +702,7 @@ static sapi_post_entry mbstr_post_entries[] = {
|
|||
/* }}} */
|
||||
|
||||
/* {{{ static int php_mb_parse_encoding_list()
|
||||
* Return 0 if input contains any illegal encoding, otherwise 1.
|
||||
* Return FAILURE if input contains any illegal encoding, otherwise SUCCESS.
|
||||
* Even if any illegal encoding is detected the result may contain a list
|
||||
* of parsed encodings.
|
||||
*/
|
||||
|
@ -779,7 +779,7 @@ php_mb_parse_encoding_list(const char *value, size_t value_length, const mbfl_en
|
|||
*entry++ = encoding;
|
||||
n++;
|
||||
} else {
|
||||
ret = 0;
|
||||
ret = FAILURE;
|
||||
}
|
||||
}
|
||||
p1 = p2 + 1;
|
||||
|
@ -795,7 +795,7 @@ php_mb_parse_encoding_list(const char *value, size_t value_length, const mbfl_en
|
|||
if (return_list) {
|
||||
*return_list = NULL;
|
||||
}
|
||||
ret = 0;
|
||||
ret = FAILURE;
|
||||
}
|
||||
if (return_size) {
|
||||
*return_size = n;
|
||||
|
@ -808,7 +808,7 @@ php_mb_parse_encoding_list(const char *value, size_t value_length, const mbfl_en
|
|||
/* }}} */
|
||||
|
||||
/* {{{ static int php_mb_parse_encoding_array()
|
||||
* Return 0 if input contains any illegal encoding, otherwise 1.
|
||||
* Return FAILURE if input contains any illegal encoding, otherwise SUCCESS.
|
||||
* Even if any illegal encoding is detected the result may contain a list
|
||||
* of parsed encodings.
|
||||
*/
|
||||
|
|
16
ext/mbstring/tests/bug76704.phpt
Normal file
16
ext/mbstring/tests/bug76704.phpt
Normal file
|
@ -0,0 +1,16 @@
|
|||
--TEST--
|
||||
Bug #76704 (mb_detect_order return value varies based on argument type)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('mbstring')) die('skip mbstring extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(mb_detect_order('Foo, UTF-8'));
|
||||
var_dump(mb_detect_order(['Foo', 'UTF-8']))
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
bool(false)
|
||||
===DONE===
|
Loading…
Add table
Add a link
Reference in a new issue