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