@@ -315,7 +315,7 @@ PHP_NAMED_FUNCTION(zif_locale_set_default)
315315 char * default_locale = NULL ;
316316
317317 ZEND_PARSE_PARAMETERS_START (1 , 1 )
318- Z_PARAM_STR (locale_name )
318+ Z_PARAM_PATH_STR (locale_name )
319319 ZEND_PARSE_PARAMETERS_END ();
320320
321321 if (ZSTR_LEN (locale_name ) == 0 ) {
@@ -481,7 +481,7 @@ static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS)
481481 intl_error_reset ( NULL );
482482
483483 ZEND_PARSE_PARAMETERS_START (1 , 1 )
484- Z_PARAM_STRING (loc_name , loc_name_len )
484+ Z_PARAM_PATH (loc_name , loc_name_len )
485485 ZEND_PARSE_PARAMETERS_END ();
486486
487487 if (loc_name_len == 0 ) {
@@ -568,9 +568,9 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
568568 intl_error_reset ( NULL );
569569
570570 ZEND_PARSE_PARAMETERS_START (1 , 2 )
571- Z_PARAM_STRING (loc_name , loc_name_len )
571+ Z_PARAM_PATH (loc_name , loc_name_len )
572572 Z_PARAM_OPTIONAL
573- Z_PARAM_STRING_OR_NULL (disp_loc_name , disp_loc_name_len )
573+ Z_PARAM_PATH_OR_NULL (disp_loc_name , disp_loc_name_len )
574574 ZEND_PARSE_PARAMETERS_END ();
575575
576576 if (loc_name_len > ULOC_FULLNAME_CAPACITY ) {
@@ -735,7 +735,7 @@ PHP_FUNCTION( locale_get_keywords )
735735 intl_error_reset ( NULL );
736736
737737 ZEND_PARSE_PARAMETERS_START (1 , 1 )
738- Z_PARAM_STRING (loc_name , loc_name_len )
738+ Z_PARAM_PATH (loc_name , loc_name_len )
739739 ZEND_PARSE_PARAMETERS_END ();
740740
741741 INTL_CHECK_LOCALE_LEN (strlen (loc_name ));
@@ -1126,7 +1126,7 @@ PHP_FUNCTION(locale_parse)
11261126 intl_error_reset ( NULL );
11271127
11281128 ZEND_PARSE_PARAMETERS_START (1 , 1 )
1129- Z_PARAM_STRING (loc_name , loc_name_len )
1129+ Z_PARAM_PATH (loc_name , loc_name_len )
11301130 ZEND_PARSE_PARAMETERS_END ();
11311131
11321132 INTL_CHECK_LOCALE_LEN (strlen (loc_name ));
@@ -1166,7 +1166,7 @@ PHP_FUNCTION(locale_get_all_variants)
11661166 intl_error_reset ( NULL );
11671167
11681168 ZEND_PARSE_PARAMETERS_START (1 , 1 )
1169- Z_PARAM_STRING (loc_name , loc_name_len )
1169+ Z_PARAM_PATH (loc_name , loc_name_len )
11701170 ZEND_PARSE_PARAMETERS_END ();
11711171
11721172 if (loc_name_len == 0 ) {
@@ -1260,8 +1260,8 @@ PHP_FUNCTION(locale_filter_matches)
12601260 intl_error_reset ( NULL );
12611261
12621262 ZEND_PARSE_PARAMETERS_START (2 , 3 )
1263- Z_PARAM_STRING (lang_tag , lang_tag_len )
1264- Z_PARAM_STRING (loc_range , loc_range_len )
1263+ Z_PARAM_PATH (lang_tag , lang_tag_len )
1264+ Z_PARAM_PATH (loc_range , loc_range_len )
12651265 Z_PARAM_OPTIONAL
12661266 Z_PARAM_BOOL (boolCanonical )
12671267 ZEND_PARSE_PARAMETERS_END ();
@@ -1434,6 +1434,10 @@ static zend_string* lookup_loc_range(const char* loc_range, HashTable* hash_arr,
14341434 zend_argument_type_error (2 , "must only contain string values" );
14351435 LOOKUP_CLEAN_RETURN (NULL );
14361436 }
1437+ if (zend_str_has_nul_byte (Z_STR_P (ele_value ))) {
1438+ zend_argument_value_error (2 , "must not contain any null bytes" );
1439+ LOOKUP_CLEAN_RETURN (NULL );
1440+ }
14371441 cur_arr [cur_arr_len * 2 ] = estrndup (Z_STRVAL_P (ele_value ), Z_STRLEN_P (ele_value ));
14381442 result = strToMatch (Z_STRVAL_P (ele_value ), cur_arr [cur_arr_len * 2 ]);
14391443 if (result == 0 ) {
@@ -1535,10 +1539,10 @@ PHP_FUNCTION(locale_lookup)
15351539
15361540 ZEND_PARSE_PARAMETERS_START (2 , 4 )
15371541 Z_PARAM_ARRAY (arr )
1538- Z_PARAM_STRING (loc_range , loc_range_len )
1542+ Z_PARAM_PATH (loc_range , loc_range_len )
15391543 Z_PARAM_OPTIONAL
15401544 Z_PARAM_BOOL (boolCanonical )
1541- Z_PARAM_STR_OR_NULL (fallback_loc_str )
1545+ Z_PARAM_PATH_STR_OR_NULL (fallback_loc_str )
15421546 ZEND_PARSE_PARAMETERS_END ();
15431547
15441548 if (loc_range_len == 0 ) {
@@ -1626,7 +1630,7 @@ PHP_FUNCTION(locale_is_right_to_left)
16261630 size_t locale_len ;
16271631
16281632 ZEND_PARSE_PARAMETERS_START (1 , 1 )
1629- Z_PARAM_STRING (locale , locale_len )
1633+ Z_PARAM_PATH (locale , locale_len )
16301634 ZEND_PARSE_PARAMETERS_END ();
16311635
16321636 if (!locale_len ) {
0 commit comments