From: Shane Caraveo Date: Sun, 19 Oct 2003 20:00:51 +0000 (+0000) Subject: make parse_url work correctly for file uri's on windows, such as X-Git-Tag: RELEASE_1_3b3~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4505a611ba8cdcc08505a5ffa0e35bda385bd374;p=php make parse_url work correctly for file uri's on windows, such as file:///c:/somepath/somefile.txt --- diff --git a/ext/standard/url.c b/ext/standard/url.c index cdddbf00f1..419b8146e9 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -126,6 +126,12 @@ PHPAPI php_url *php_url_parse(char *str) s = e + 3; if (!strncasecmp("file", ret->scheme, sizeof("file"))) { if (*(e + 3) == '/') { + /* support windows drive letters as in: + file:///c:/somedir/file.txt + */ + if (*(e + 5) == ':') { + s = e + 4; + } goto nohost; } }