From: Ilia Alshanetsky Date: Thu, 17 Oct 2002 13:59:55 +0000 (+0000) Subject: Added support for file:/. Thanks to Thies for noticing the problem. X-Git-Tag: php-4.3.0pre2~315 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cdf39db369582c68229de6d78397740e7bea2d51;p=php Added support for file:/. Thanks to Thies for noticing the problem. --- diff --git a/ext/standard/url.c b/ext/standard/url.c index 044bd830ce..9b75a03f41 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -94,10 +94,15 @@ PHPAPI php_url *php_url_parse(char *str) ue = s + length; /* parse scheme */ - if ((e = strchr(s, ':')) && *(e+1) == '/' && *(e+2) == '/' && (e-s)) { + if ((e = strchr(s, ':')) && *(e+1) == '/' && (e-s)) { ret->scheme = estrndup(s, (e-s)); php_replace_controlchars(ret->scheme); - s = e + 3; + + if (*(e+2) == '/') { + s = e + 3; + } else { + s = e + 2; + } } else if (e) { /* no scheme, look for port */ p = e + 1; pp = p;