@@ -268,15 +268,7 @@ static const mbfl_encoding *php_mb_get_encoding(zend_string *encoding_name, uint
268
268
}
269
269
}
270
270
271
- static const mbfl_encoding * php_mb_get_encoding_or_pass (const char * encoding_name ) {
272
- if (strcmp (encoding_name , "pass" ) == 0 ) {
273
- return & mbfl_encoding_pass ;
274
- }
275
-
276
- return mbfl_name2encoding (encoding_name );
277
- }
278
-
279
- static const mbfl_encoding * php_mb_get_encoding_or_pass_ex (const char * encoding_name , size_t encoding_name_len ) {
271
+ static const mbfl_encoding * php_mb_get_encoding_or_pass (const char * encoding_name , size_t encoding_name_len ) {
280
272
if (strncmp (encoding_name , "pass" , encoding_name_len ) == 0 ) {
281
273
return & mbfl_encoding_pass ;
282
274
}
@@ -351,7 +343,7 @@ static zend_result php_mb_parse_encoding_list(const char *value, size_t value_le
351
343
}
352
344
} else {
353
345
const mbfl_encoding * encoding =
354
- allow_pass_encoding ? php_mb_get_encoding_or_pass_ex (p1 , p1_length ) : mbfl_name2encoding_ex (p1 , p1_length );
346
+ allow_pass_encoding ? php_mb_get_encoding_or_pass (p1 , p1_length ) : mbfl_name2encoding_ex (p1 , p1_length );
355
347
if (!encoding ) {
356
348
/* Called from an INI setting modification */
357
349
if (arg_num == 0 ) {
@@ -762,7 +754,7 @@ static PHP_INI_MH(OnUpdate_mbstring_http_input)
762
754
/* }}} */
763
755
764
756
static zend_result _php_mb_ini_mbstring_http_output_set (const char * new_value , size_t length ) {
765
- const mbfl_encoding * encoding = php_mb_get_encoding_or_pass (new_value );
757
+ const mbfl_encoding * encoding = php_mb_get_encoding_or_pass (new_value , length );
766
758
if (!encoding ) {
767
759
return FAILURE ;
768
760
}
@@ -1345,7 +1337,7 @@ PHP_FUNCTION(mb_http_output)
1345
1337
ZEND_ASSERT (MBSTRG (current_http_output_encoding ));
1346
1338
RETURN_STRING (MBSTRG (current_http_output_encoding )-> name );
1347
1339
} else {
1348
- const mbfl_encoding * encoding = php_mb_get_encoding_or_pass (name );
1340
+ const mbfl_encoding * encoding = php_mb_get_encoding_or_pass (name , name_len );
1349
1341
if (!encoding ) {
1350
1342
zend_argument_value_error (1 , "must be a valid encoding, \"%s\" given" , name );
1351
1343
RETURN_THROWS ();
0 commit comments