mirror of
https://github.com/php/php-src.git
synced 2024-09-23 02:47:26 +00:00
MFH: Fixed bug #43353 (wrong detection of 'data' wrapper causes notice)
This commit is contained in:
parent
e0fededeba
commit
0a2bfc7968
18
ext/standard/tests/file/bug43353.phpt
Normal file
18
ext/standard/tests/file/bug43353.phpt
Normal file
@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug #43353 wrong detection of 'data' wrapper
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(is_dir('file:///datafoo:test'));
|
||||
var_dump(is_dir('datafoo:test'));
|
||||
var_dump(file_get_contents('data:text/plain,foo'));
|
||||
var_dump(file_get_contents('datafoo:text/plain,foo'));
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
bool(false)
|
||||
string(3) "foo"
|
||||
|
||||
Warning: file_get_contents(datafoo:text/plain,foo): failed to open stream: No such file or directory in %s
|
||||
bool(false)
|
@ -1521,7 +1521,7 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, char
|
||||
n++;
|
||||
}
|
||||
|
||||
if ((*p == ':') && (n > 1) && (!strncmp("//", p+1, 2) || !memcmp("data", path, 4))) {
|
||||
if ((*p == ':') && (n > 1) && (!strncmp("//", p+1, 2) || (n == 4 && !memcmp("data:", path, 5)))) {
|
||||
protocol = path;
|
||||
} else if (n == 5 && strncasecmp(path, "zlib:", 5) == 0) {
|
||||
/* BC with older php scripts and zlib wrapper */
|
||||
|
Loading…
Reference in New Issue
Block a user