File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -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 ) {
Original file line number Diff line number Diff line change @@ -86,6 +86,12 @@ function ut_main()
86
86
$ res_str .= "\n" ;
87
87
}
88
88
89
+ try {
90
+ ut_loc_set_default ("a- \0DE " );
91
+ } catch (\ValueError $ e ) {
92
+ echo $ e ->getMessage (), PHP_EOL ;
93
+ }
94
+
89
95
return $ res_str ;
90
96
91
97
}
@@ -95,6 +101,8 @@ ut_run();
95
101
96
102
?>
97
103
--EXPECT--
104
+ Locale::setDefault(): Argument #1 ($locale) must not contain any null bytes
105
+ locale_set_default(): Argument #1 ($locale) must not contain any null bytes
98
106
uk-ua_CALIFORNIA@currency=;currency=GRN: set locale 'uk-ua_CALIFORNIA@currency=;currency=GRN'
99
107
root: set locale 'root'
100
108
uk@currency=EURO: set locale 'uk@currency=EURO'
You can’t perform that action at this time.
0 commit comments