From: Ilia Alshanetsky Date: Tue, 16 Aug 2005 14:10:13 +0000 (+0000) Subject: Fixed bug #34148 (+,- and . not supported as parts of scheme). X-Git-Tag: PRE_NEW_OCI8_EXTENSION~221 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b3d7ae9399128311470309891f1aa07b6feb6a50;p=php Fixed bug #34148 (+,- and . not supported as parts of scheme). --- diff --git a/NEWS b/NEWS index 9cad76dc2a..d91c3dc43a 100644 --- 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. diff --git a/ext/standard/tests/strings/url_t.phpt b/ext/standard/tests/strings/url_t.phpt index 1e4dd3566d..f6fec50de9 100644 --- a/ext/standard/tests/strings/url_t.phpt +++ b/ext/standard/tests/strings/url_t.phpt @@ -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" +} diff --git a/ext/standard/url.c b/ext/standard/url.c index dc2f2beee9..1e5dece138 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -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 {