mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
6df7557e43
For mb_parse_str, when mbstring.http_input (INI parameter) is a list of multiple possible text encodings (which is not the case by default), this new implementation is about 25% faster. When mbstring.http_input is a single value, then nothing is changed. (No automatic encoding detection is done in that case.)
43 lines
751 B
PHP
43 lines
751 B
PHP
--TEST--
|
|
mb_http_input() with POST method and multiple candidate encodings
|
|
--EXTENSIONS--
|
|
mbstring
|
|
--POST--
|
|
a=日本語&b=ελληνικά
|
|
--INI--
|
|
mbstring.encoding_translation=1
|
|
input_encoding=UTF-8,SJIS,EUC-JP,ISO-8859-1
|
|
--FILE--
|
|
<?php
|
|
|
|
echo $_POST['a']."\n";
|
|
echo $_POST['b']."\n";
|
|
|
|
// Get encoding
|
|
var_dump(mb_http_input('P'));
|
|
var_dump(mb_http_input('G'));
|
|
var_dump(mb_http_input('C'));
|
|
var_dump(mb_http_input('S'));
|
|
var_dump(mb_http_input('I'));
|
|
var_dump(mb_http_input('L'));
|
|
|
|
?>
|
|
--EXPECT--
|
|
日本語
|
|
ελληνικά
|
|
string(5) "UTF-8"
|
|
bool(false)
|
|
bool(false)
|
|
bool(false)
|
|
array(4) {
|
|
[0]=>
|
|
string(5) "UTF-8"
|
|
[1]=>
|
|
string(4) "SJIS"
|
|
[2]=>
|
|
string(6) "EUC-JP"
|
|
[3]=>
|
|
string(10) "ISO-8859-1"
|
|
}
|
|
string(28) "UTF-8,SJIS,EUC-JP,ISO-8859-1"
|