summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2006-02-12 16:39:44 +0000
committerIlia Alshanetsky <iliaa@php.net>2006-02-12 16:39:44 +0000
commit535a2e6092d95e15a4d6cf420f8a629350ee4253 (patch)
tree36920653f03c86a956329aeb7267979e08806b01
parent5fb8810c76d1f66602a9661fde8e68b95d655e0e (diff)
downloadphp-git-535a2e6092d95e15a4d6cf420f8a629350ee4253.tar.gz
Fixed bug #36351 (parse_url() does not parse numeric paths properly).
-rw-r--r--NEWS1
-rw-r--r--ext/standard/tests/strings/url_t.phpt7
-rw-r--r--ext/standard/url.c2
3 files changed, 9 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 7e35723b67..95d85cca84 100644
--- 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
diff --git a/ext/standard/tests/strings/url_t.phpt b/ext/standard/tests/strings/url_t.phpt
index be95e02949..2d18fa5c03 100644
--- a/ext/standard/tests/strings/url_t.phpt
+++ b/ext/standard/tests/strings/url_t.phpt
@@ -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)
diff --git a/ext/standard/url.c b/ext/standard/url.c
index 43c47b38d9..d425e985c7 100644
--- a/ext/standard/url.c
+++ b/ext/standard/url.c
@@ -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;
}