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

diff --git a/NEWS b/NEWS
index 9cad76dc2afd28c942ee293538dac87ea86088f6..d91c3dc43ad835ce71bb6f91b2823c4b49272a2b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? ????, PHP 6.0
+- Fixed bug #34148 (+,- and . not supported as parts of scheme). (Ilia)
 - cURL improvements (Ilia)
   . Added curl_setopt_array() which allows setting of multiple cURL options.
   . Added CURLINFO_HEADER_OUT to facilitate request retrieval.
index 1e4dd3566df84bbd7089761a731df9efde86020a..f6fec50de94443e88f82e67d44cba5121bb6243e 100644 (file)
@@ -68,7 +68,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) {
@@ -662,3 +663,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 dc2f2beee9204812ac8ad58cdefbd77d843461d0..1e5dece138cd1809acaf6df934f50e2ed01b60d8 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 {