summaryrefslogtreecommitdiff
path: root/main/streams/streams.c
diff options
context:
space:
mode:
authorShane Caraveo <shane@php.net>2003-10-19 20:59:12 +0000
committerShane Caraveo <shane@php.net>2003-10-19 20:59:12 +0000
commit2a41429472dbd9e3423cda24937f69b0ae744668 (patch)
tree5c2f355f4f46076df8ad6a68852efd15623a852e /main/streams/streams.c
parent0029a45795060391e41d2423d15f5fe76c2fb119 (diff)
downloadphp-git-2a41429472dbd9e3423cda24937f69b0ae744668.tar.gz
A simpler patch to add file uri support
Diffstat (limited to 'main/streams/streams.c')
-rwxr-xr-xmain/streams/streams.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/main/streams/streams.c b/main/streams/streams.c
index 49a34cdcdb..d7579378c1 100755
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -1415,14 +1415,20 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, char
}
/* TODO: curl based streams probably support file:// properly */
if (!protocol || !strncasecmp(protocol, "file", n)) {
- if (protocol && path[n+1] == '/' && path[n+2] == '/') {
+ if (protocol && path[n+1] == '/' && path[n+2] == '/' && path[n+3] != '/') {
if (options & REPORT_ERRORS) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "remote host file access not supported, %s", path);
}
return NULL;
}
if (protocol && path_for_open) {
+ /* skip past protocol and :/, but handle windows correctly */
*path_for_open = (char*)path + n + 1;
+ while (*(++*path_for_open)=='/');
+#ifdef PHP_WIN32
+ if (*(*path_for_open + 1) != ':')
+#endif
+ *path_for_open--;
}
/* fall back on regular file access */