Fixed bug #36351 (parse_url() does not parse numeric paths properly).
authorIlia Alshanetsky <iliaa@php.net>
Sun, 12 Feb 2006 16:39:44 +0000 (16:39 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 12 Feb 2006 16:39:44 +0000 (16:39 +0000)
NEWS
ext/standard/tests/strings/url_t.phpt
ext/standard/url.c

diff --git a/NEWS b/NEWS
index 7e35723b677bc0aefbbdf18ff80204100f3081e6..95d85cca84db61e568f5ab0d465c7fe1b88684b7 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -23,6 +23,7 @@ PHP                                                                        NEWS
 - Added imap_savebody() that allows message body to be written to a file. (Mike)
 - Fixed bug #36359 (splFileObject::fwrite() doesn't write when no data length 
   specified). (Tony)
+- Fixed bug #36351 (parse_url() does not parse numeric paths properly). (Ilia)
 - Fixed bug #36334 (Added missing documentation about realpath cache INI 
   settings). (Ilia)
 - Fixed bug #36308 (ReflectionProperty::getDocComment() does not reflect 
index be95e0294974647babf41c60e6e89766c89009da..2d18fa5c036aac1f464bcfe8cb9553d095a4edbc 100644 (file)
@@ -70,6 +70,7 @@ $sample_urls = array (
 'http://foo.com#bar',
 'scheme:',
 'foo+bar://baz@bang/bla',
+'gg:9130731',
 );
 
     foreach ($sample_urls as $url) {
@@ -678,6 +679,12 @@ array(4) {
   ["path"]=>
   string(4) "/bla"
 }
+array(2) {
+  ["scheme"]=>
+  string(2) "gg"
+  ["path"]=>
+  string(7) "9130731"
+}
 string(4) "http"
 string(11) "www.php.net"
 int(80)
index 43c47b38d9c8f08cbfff257d6aa245c5a8fb3e93..d425e985c71888f319ebe1ccde0e81e3317e4459 100644 (file)
@@ -138,7 +138,7 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length)
                                p++;
                        }
                        
-                       if ((*p) == '\0' || *p == '/') {
+                       if ((*p == '\0' || *p == '/') && (p - e) < 7) {
                                goto parse_port;
                        }