]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #34148 (+,- and . not supported as parts of scheme).
authorIlia Alshanetsky <iliaa@php.net>
Tue, 16 Aug 2005 14:12:13 +0000 (14:12 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 16 Aug 2005 14:12:13 +0000 (14:12 +0000)
NEWS
ext/standard/tests/strings/url_t.phpt
ext/standard/url.c

diff --git a/NEWS b/NEWS
index 91662b4fa3b8ddb2f7de66028774dc01c94e1305..1d8ccda05c7dfc794c01e071f180275bdd8311ff 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
 PHP 4                                                                      NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2005, Version 4.4.1
+- Fixed bug #34148 (+,- and . not supported as parts of scheme). (Ilia)
 - Fixed bug #34068 (Numeric string as array key not cast to integer in 
   wddx_deserialize()). (Ilia)
 - Fixed bug #34064 (arr[] as param to function is allowed only if function 
index 6e65b1d1bbdc3c200537b56974b48c5c25ce3f83..86605ace272ed2ac080ec2b6c8d867ea7c7fdee7 100644 (file)
@@ -70,7 +70,8 @@ $sample_urls = array (
 'file:/path/to/file',
 'http://1.2.3.4:/abc.asp?a=1&b=2',
 'http://foo.com#bar',
-'scheme:'
+'scheme:',
+'foo+bar://baz@bang/bla',
 );
 
     foreach ($sample_urls as $url) {
@@ -664,3 +665,13 @@ array(1) {
   ["scheme"]=>
   string(6) "scheme"
 }
+array(4) {
+  ["scheme"]=>
+  string(7) "foo+bar"
+  ["host"]=>
+  string(4) "bang"
+  ["user"]=>
+  string(3) "baz"
+  ["path"]=>
+  string(4) "/bla"
+}
index b6514850e6637398c9254682e530200ec41c98b8..3805f54adbd47eb48a902e1447c57c2a4770752e 100644 (file)
@@ -107,7 +107,8 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length)
                /* validate scheme */
                p = s;
                while (p < e) {
-                       if (!isalnum(*p)) {
+                       /* scheme = 1*[ lowalpha | digit | "+" | "-" | "." ] */
+                       if (!isalpha(*p) && !isdigit(*p) && *p != '+' && *p != '.' && *p != '-') {
                                if (e + 1 < ue) {
                                        goto parse_port;
                                } else {