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)
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 ) {
Original file line number Diff line number Diff line change @@ -86,6 +86,12 @@ function ut_main()
8686 $ res_str .= "\n" ;
8787 }
8888
89+ try {
90+ ut_loc_set_default ("a- \0DE " );
91+ } catch (\ValueError $ e ) {
92+ echo $ e ->getMessage (), PHP_EOL ;
93+ }
94+
8995 return $ res_str ;
9096
9197}
@@ -95,6 +101,8 @@ ut_run();
95101
96102?>
97103--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
98106uk-ua_CALIFORNIA@currency=;currency=GRN: set locale 'uk-ua_CALIFORNIA@currency=;currency=GRN'
99107root: set locale 'root'
100108uk@currency=EURO: set locale 'uk@currency=EURO'
You can’t perform that action at this time.
0 commit comments