]> granicus.if.org Git - php/commitdiff
Added handling for file:/ schema, which does not contain a host.
authorIlia Alshanetsky <iliaa@php.net>
Fri, 18 Oct 2002 23:54:58 +0000 (23:54 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 18 Oct 2002 23:54:58 +0000 (23:54 +0000)
ext/standard/url.c

index 9b75a03f418443f7d2f9ea8a631346b134ac127e..42270700604a96496c43aaf80d41f2bfae1c7a72 100644 (file)
@@ -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, '#');