diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2002-10-17 13:59:55 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2002-10-17 13:59:55 +0000 |
commit | cdf39db369582c68229de6d78397740e7bea2d51 (patch) | |
tree | c25c05d44f93ae67a389f37d464d5f15c9193245 /ext/standard/url.c | |
parent | d023b841a2672c6670a09587530ce9858ed22626 (diff) | |
download | php-git-cdf39db369582c68229de6d78397740e7bea2d51.tar.gz |
Added support for file:/. Thanks to Thies for noticing the problem.
Diffstat (limited to 'ext/standard/url.c')
-rw-r--r-- | ext/standard/url.c | 9 |
1 files changed, 7 insertions, 2 deletions
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; |