]> granicus.if.org Git - php/commitdiff
Fixed bug #20420 and added partial urls to the test of the function.
authorIlia Alshanetsky <iliaa@php.net>
Thu, 14 Nov 2002 13:40:14 +0000 (13:40 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 14 Nov 2002 13:40:14 +0000 (13:40 +0000)
ext/standard/tests/strings/url_t.phpt
ext/standard/url.c

index fef91799e0b4432ad3e99ea0223206d3d39ef557..78cf2bbeeb63dccf21e417c105075f4fde578088 100644 (file)
@@ -61,7 +61,9 @@ $sample_urls = array (
 'zlib:filename.txt',
 'zlib:/path/to/my/file/file.txt',
 'foo://foo@bar',
-'mailto:me@mydomain.com'
+'mailto:me@mydomain.com',
+'/foo.php?a=b&c=d',
+'foo.php?a=b&c=d'
 );
 
     foreach ($sample_urls as $url) {
@@ -181,7 +183,7 @@ array(3) {
 }
 array(1) {
   ["path"]=>
-  string(13) "www.php.net/?"
+  string(12) "www.php.net/"
 }
 array(3) {
   ["host"]=>
@@ -587,3 +589,15 @@ array(2) {
   ["path"]=>
   string(15) "me@mydomain.com"
 }
+array(2) {
+  ["path"]=>
+  string(8) "/foo.php"
+  ["query"]=>
+  string(7) "a=b&c=d"
+}
+array(2) {
+  ["path"]=>
+  string(7) "foo.php"
+  ["query"]=>
+  string(7) "a=b&c=d"
+}
index 781b0ca5b5ab70c9361ea4cb8be4d28af8d5d59b..9c8ce60c14740870a54351e5776d8fcaa112fc12 100644 (file)
@@ -153,9 +153,8 @@ PHPAPI php_url *php_url_parse(char *str)
                }
        } else {
                just_path:
-               ret->path = estrndup(s, length);
-               php_replace_controlchars(ret->path);
-               return ret;
+               ue = s + length;
+               goto nohost;
        }
        
        if (!(e = strchr(s, '/'))) {