@@ -315,7 +315,7 @@ PHP_NAMED_FUNCTION(zif_locale_set_default)
315
315
char * default_locale = NULL ;
316
316
317
317
ZEND_PARSE_PARAMETERS_START (1 , 1 )
318
- Z_PARAM_STR (locale_name )
318
+ Z_PARAM_PATH_STR (locale_name )
319
319
ZEND_PARSE_PARAMETERS_END ();
320
320
321
321
if (ZSTR_LEN (locale_name ) == 0 ) {
@@ -481,7 +481,7 @@ static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS)
481
481
intl_error_reset ( NULL );
482
482
483
483
ZEND_PARSE_PARAMETERS_START (1 , 1 )
484
- Z_PARAM_STRING (loc_name , loc_name_len )
484
+ Z_PARAM_PATH (loc_name , loc_name_len )
485
485
ZEND_PARSE_PARAMETERS_END ();
486
486
487
487
if (loc_name_len == 0 ) {
@@ -568,9 +568,9 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
568
568
intl_error_reset ( NULL );
569
569
570
570
ZEND_PARSE_PARAMETERS_START (1 , 2 )
571
- Z_PARAM_STRING (loc_name , loc_name_len )
571
+ Z_PARAM_PATH (loc_name , loc_name_len )
572
572
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 )
574
574
ZEND_PARSE_PARAMETERS_END ();
575
575
576
576
if (loc_name_len > ULOC_FULLNAME_CAPACITY ) {
@@ -735,7 +735,7 @@ PHP_FUNCTION( locale_get_keywords )
735
735
intl_error_reset ( NULL );
736
736
737
737
ZEND_PARSE_PARAMETERS_START (1 , 1 )
738
- Z_PARAM_STRING (loc_name , loc_name_len )
738
+ Z_PARAM_PATH (loc_name , loc_name_len )
739
739
ZEND_PARSE_PARAMETERS_END ();
740
740
741
741
INTL_CHECK_LOCALE_LEN (strlen (loc_name ));
@@ -1126,7 +1126,7 @@ PHP_FUNCTION(locale_parse)
1126
1126
intl_error_reset ( NULL );
1127
1127
1128
1128
ZEND_PARSE_PARAMETERS_START (1 , 1 )
1129
- Z_PARAM_STRING (loc_name , loc_name_len )
1129
+ Z_PARAM_PATH (loc_name , loc_name_len )
1130
1130
ZEND_PARSE_PARAMETERS_END ();
1131
1131
1132
1132
INTL_CHECK_LOCALE_LEN (strlen (loc_name ));
@@ -1166,7 +1166,7 @@ PHP_FUNCTION(locale_get_all_variants)
1166
1166
intl_error_reset ( NULL );
1167
1167
1168
1168
ZEND_PARSE_PARAMETERS_START (1 , 1 )
1169
- Z_PARAM_STRING (loc_name , loc_name_len )
1169
+ Z_PARAM_PATH (loc_name , loc_name_len )
1170
1170
ZEND_PARSE_PARAMETERS_END ();
1171
1171
1172
1172
if (loc_name_len == 0 ) {
@@ -1260,8 +1260,8 @@ PHP_FUNCTION(locale_filter_matches)
1260
1260
intl_error_reset ( NULL );
1261
1261
1262
1262
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 )
1265
1265
Z_PARAM_OPTIONAL
1266
1266
Z_PARAM_BOOL (boolCanonical )
1267
1267
ZEND_PARSE_PARAMETERS_END ();
@@ -1434,6 +1434,10 @@ static zend_string* lookup_loc_range(const char* loc_range, HashTable* hash_arr,
1434
1434
zend_argument_type_error (2 , "must only contain string values" );
1435
1435
LOOKUP_CLEAN_RETURN (NULL );
1436
1436
}
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
+ }
1437
1441
cur_arr [cur_arr_len * 2 ] = estrndup (Z_STRVAL_P (ele_value ), Z_STRLEN_P (ele_value ));
1438
1442
result = strToMatch (Z_STRVAL_P (ele_value ), cur_arr [cur_arr_len * 2 ]);
1439
1443
if (result == 0 ) {
@@ -1535,10 +1539,10 @@ PHP_FUNCTION(locale_lookup)
1535
1539
1536
1540
ZEND_PARSE_PARAMETERS_START (2 , 4 )
1537
1541
Z_PARAM_ARRAY (arr )
1538
- Z_PARAM_STRING (loc_range , loc_range_len )
1542
+ Z_PARAM_PATH (loc_range , loc_range_len )
1539
1543
Z_PARAM_OPTIONAL
1540
1544
Z_PARAM_BOOL (boolCanonical )
1541
- Z_PARAM_STR_OR_NULL (fallback_loc_str )
1545
+ Z_PARAM_PATH_STR_OR_NULL (fallback_loc_str )
1542
1546
ZEND_PARSE_PARAMETERS_END ();
1543
1547
1544
1548
if (loc_range_len == 0 ) {
@@ -1626,7 +1630,7 @@ PHP_FUNCTION(locale_is_right_to_left)
1626
1630
size_t locale_len ;
1627
1631
1628
1632
ZEND_PARSE_PARAMETERS_START (1 , 1 )
1629
- Z_PARAM_STRING (locale , locale_len )
1633
+ Z_PARAM_PATH (locale , locale_len )
1630
1634
ZEND_PARSE_PARAMETERS_END ();
1631
1635
1632
1636
if (!locale_len ) {
0 commit comments