]> granicus.if.org Git - php/commitdiff
Added support for file:/. Thanks to Thies for noticing the problem.
authorIlia Alshanetsky <iliaa@php.net>
Thu, 17 Oct 2002 13:59:55 +0000 (13:59 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 17 Oct 2002 13:59:55 +0000 (13:59 +0000)
ext/standard/url.c

index 044bd830ce4cafb47d49c4d05ea047948e0b1828..9b75a03f418443f7d2f9ea8a631346b134ac127e 100644 (file)
@@ -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;