]> granicus.if.org Git - php/commitdiff
MFH
authorIlia Alshanetsky <iliaa@php.net>
Tue, 31 Dec 2002 18:54:38 +0000 (18:54 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 31 Dec 2002 18:54:38 +0000 (18:54 +0000)
ext/standard/tests/strings/url_t.phpt
ext/standard/url.c

index 78a6706f5416a0f2638870dcb1eedc8c0bcb3f24..29ee7fb48e6acc76cdd8cc969194fdb6839ca636 100644 (file)
@@ -64,7 +64,10 @@ $sample_urls = array (
 'mailto:me@mydomain.com',
 '/foo.php?a=b&c=d',
 'foo.php?a=b&c=d',
-'http://user:passwd@www.example.com:8080?bar=1&boom=0'
+'http://user:passwd@www.example.com:8080?bar=1&boom=0',
+'file:///path/to/file',
+'file://path/to/file',
+'file:/path/to/file'
 );
 
     foreach ($sample_urls as $url) {
@@ -616,3 +619,21 @@ array(6) {
   ["query"]=>
   string(12) "bar=1&boom=0"
 }
+array(2) {
+  ["scheme"]=>
+  string(4) "file"
+  ["path"]=>
+  string(13) "/path/to/file"
+}
+array(2) {
+  ["scheme"]=>
+  string(4) "file"
+  ["path"]=>
+  string(12) "path/to/file"
+}
+array(2) {
+  ["scheme"]=>
+  string(4) "file"
+  ["path"]=>
+  string(13) "/path/to/file"
+}
index 8752a6a201b1a07e3b5c26ba6b7be54d08e0d98c..99a6c5df60839633e9bfb2e9aa5b650f5d7b608c 100644 (file)
@@ -124,6 +124,9 @@ PHPAPI php_url *php_url_parse(char *str)
                
                        if (*(e+2) == '/') {
                                s = e + 3;
+                               if (!strncasecmp("file", ret->scheme, sizeof("file"))) {
+                                       goto nohost;
+                               }
                        } else {
                                s = e + 1;
                                if (!strncasecmp("file", ret->scheme, sizeof("file"))) {