summaryrefslogtreecommitdiff
path: root/main/streams/plain_wrapper.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/plain_wrapper.c
parent0029a45795060391e41d2423d15f5fe76c2fb119 (diff)
downloadphp-git-2a41429472dbd9e3423cda24937f69b0ae744668.tar.gz
A simpler patch to add file uri support
Diffstat (limited to 'main/streams/plain_wrapper.c')
-rw-r--r--main/streams/plain_wrapper.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index 1f060ec666..5286f4fcb2 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -882,6 +882,16 @@ static php_stream *php_plain_files_dir_opener(php_stream_wrapper *wrapper, char
static php_stream *php_plain_files_stream_opener(php_stream_wrapper *wrapper, char *path, char *mode,
int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC)
{
+ char *filename = path;
+ if (!strncasecmp(filename, "file:", sizeof("file:")-1)) {
+ filename += 6;
+ while (*(++filename)=='/');
+#ifdef PHP_WIN32
+ if (*(filename + 1) != ':')
+#endif
+ filename--;
+ }
+
if ((options & USE_PATH) && PG(include_path) != NULL) {
return php_stream_fopen_with_path_rel(path, mode, PG(include_path), opened_path, options);
}