-
Notifications
You must be signed in to change notification settings - Fork 7.9k
PHP 8.0: Make stream wrapper and windows drive checks locale-independent #7820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: PHP-8.0
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--TEST-- | ||
FILTER_VALIDATE_DOMAIN FILTER_FLAG_HOSTNAME should not be locale dependent | ||
--EXTENSIONS-- | ||
filter | ||
--SKIPIF-- | ||
<?php // try to activate a single-byte german locale | ||
if (!setlocale(LC_ALL, 'de_DE', 'de_DE.ISO8859-1', 'de_DE.ISO_8859-1')) { | ||
print "skip Can't find german locale\n"; | ||
} | ||
?> | ||
--FILE-- | ||
<?php | ||
var_dump(filter_var('٪', FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)); | ||
setlocale(LC_ALL, 'de_DE', 'de_DE.ISO8859-1', 'de_DE.ISO_8859-1'); | ||
var_dump(filter_var('٪', FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME)); | ||
?> | ||
--EXPECT-- | ||
bool(false) | ||
bool(false) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--TEST-- | ||
Stream wrappers should not be locale dependent | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test passes on Windows also without the patch for some reason. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the locale files might depend on OS too, for some reason, I remember seeing something about that while looking at other tests |
||
--SKIPIF-- | ||
<?php // try to activate a single-byte german locale | ||
if (!setlocale(LC_ALL, 'de_DE','de_DE.ISO8859-1','de_DE.ISO_8859-1')) { | ||
print "skip Can't find german locale\n"; | ||
} | ||
?> | ||
--INI-- | ||
allow_url_fopen=1 | ||
display_errors=stderr | ||
--FILE-- | ||
<?php | ||
setlocale(LC_ALL, 'de_DE', 'de_DE.ISO8859-1', 'de_DE.ISO_8859-1'); | ||
class testwrapper { | ||
} | ||
|
||
var_dump(stream_wrapper_register("test٪", 'testwrapper', STREAM_IS_URL)); | ||
|
||
echo 'stream_open: '; | ||
fopen("test٪://test", 'r'); | ||
?> | ||
--EXPECTF-- | ||
Warning: stream_wrapper_register(): Invalid protocol scheme specified. Unable to register wrapper class testwrapper to test٪:// in %s on line 6 | ||
bool(false) | ||
stream_open: Warning: fopen(test٪://test): Failed to open stream: No such file or directory in %s on line 9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.