summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2002-11-14 13:44:24 +0000
committerIlia Alshanetsky <iliaa@php.net>2002-11-14 13:44:24 +0000
commitc60242c94424992e69911fc7c877b975dfc5fb54 (patch)
treef52b2ab62220db2afcd0e9f579dd0ac180526122
parent65995b5c4f0048be7514e7322c8dd48348cf49a9 (diff)
downloadphp-git-c60242c94424992e69911fc7c877b975dfc5fb54.tar.gz
MFH (parse_url bug).
-rw-r--r--ext/standard/tests/strings/url_t.phpt18
-rw-r--r--ext/standard/url.c5
2 files changed, 18 insertions, 5 deletions
diff --git a/ext/standard/tests/strings/url_t.phpt b/ext/standard/tests/strings/url_t.phpt
index fef91799e0..78cf2bbeeb 100644
--- a/ext/standard/tests/strings/url_t.phpt
+++ b/ext/standard/tests/strings/url_t.phpt
@@ -61,7 +61,9 @@ $sample_urls = array (
'zlib:filename.txt',
'zlib:/path/to/my/file/file.txt',
'foo://foo@bar',
-'mailto:me@mydomain.com'
+'mailto:me@mydomain.com',
+'/foo.php?a=b&c=d',
+'foo.php?a=b&c=d'
);
foreach ($sample_urls as $url) {
@@ -181,7 +183,7 @@ array(3) {
}
array(1) {
["path"]=>
- string(13) "www.php.net/?"
+ string(12) "www.php.net/"
}
array(3) {
["host"]=>
@@ -587,3 +589,15 @@ array(2) {
["path"]=>
string(15) "me@mydomain.com"
}
+array(2) {
+ ["path"]=>
+ string(8) "/foo.php"
+ ["query"]=>
+ string(7) "a=b&c=d"
+}
+array(2) {
+ ["path"]=>
+ string(7) "foo.php"
+ ["query"]=>
+ string(7) "a=b&c=d"
+}
diff --git a/ext/standard/url.c b/ext/standard/url.c
index 781b0ca5b5..9c8ce60c14 100644
--- a/ext/standard/url.c
+++ b/ext/standard/url.c
@@ -153,9 +153,8 @@ PHPAPI php_url *php_url_parse(char *str)
}
} else {
just_path:
- ret->path = estrndup(s, length);
- php_replace_controlchars(ret->path);
- return ret;
+ ue = s + length;
+ goto nohost;
}
if (!(e = strchr(s, '/'))) {