From: Ilia Alshanetsky Date: Fri, 18 Oct 2002 23:54:58 +0000 (+0000) Subject: Added handling for file:/ schema, which does not contain a host. X-Git-Tag: php-4.3.0pre2~289 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c3270448ac66ed6c3c85d63a2fa337ed240269f8;p=php Added handling for file:/ schema, which does not contain a host. --- 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, '#');