summaryrefslogtreecommitdiff
path: root/ext/standard/url.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/url.c')
-rw-r--r--ext/standard/url.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/standard/url.c b/ext/standard/url.c
index 9b75a03f41..4227070060 100644
--- a/ext/standard/url.c
+++ b/ext/standard/url.c
@@ -101,7 +101,10 @@ PHPAPI php_url *php_url_parse(char *str)
if (*(e+2) == '/') {
s = e + 3;
} else {
- s = e + 2;
+ s = e + 1;
+ if (!strncasecmp("file", ret->scheme, sizeof("file"))) {
+ goto nohost;
+ }
}
} else if (e) { /* no scheme, look for port */
p = e + 1;
@@ -186,6 +189,8 @@ PHPAPI php_url *php_url_parse(char *str)
s = e;
+ nohost:
+
if ((p = strchr(s, '?'))) {
pp = strchr(s, '#');