diff options
author | Stanislav Malyshev <stas@php.net> | 2014-04-24 23:49:52 -0700 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2014-04-24 23:50:45 -0700 |
commit | a32880380335a8bc25140ddb0e94b49c47416bbe (patch) | |
tree | 588f4b663e14570aa8d2c85ab8b53e53d15c3daf | |
parent | 03be983398b75fdc147406e73a5d0dddd4533c08 (diff) | |
download | php-git-a32880380335a8bc25140ddb0e94b49c47416bbe.tar.gz |
Revert "Fixed bug #64604"
This reverts commit b05c088a3abf8e4c6fb6e40418423a9e2dd3d929.
Breaks parsing urls where query has : in it, like: /foo/bar?baz=goo:boo
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | ext/standard/tests/url/bug64604.phpt | 40 | ||||
-rw-r--r-- | ext/standard/url.c | 8 |
3 files changed, 4 insertions, 46 deletions
@@ -25,8 +25,6 @@ PHP NEWS . Fixed bug #61019 (Out of memory on command stream_get_contents). (Mike) . Fixed bug #64330 (stream_socket_server() creates wrong Abstract Namespace UNIX sockets). (Mike) - . Fixed bug #64604 (parse_url is inconsistent with specified port). - (Ingo Walz) . Fixed bug #66171 (Symlinks and session handler allow open_basedir bypass). (Jann Horn, Stas) . Fixed bug #66182 (exit in stream filter produces segfault). (Mike) diff --git a/ext/standard/tests/url/bug64604.phpt b/ext/standard/tests/url/bug64604.phpt deleted file mode 100644 index bbc3cb9d1b..0000000000 --- a/ext/standard/tests/url/bug64604.phpt +++ /dev/null @@ -1,40 +0,0 @@ ---TEST-- -Bug #64604 parse_url is inconsistent with specified port ---FILE-- -<?php -var_dump(parse_url('//localhost/path')); -var_dump(parse_url('//localhost:80/path')); -var_dump(parse_url('//localhost:/path')); -var_dump(parse_url('http://localhost:80/path')); -?> ---EXPECT-- -array(2) { - ["host"]=> - string(9) "localhost" - ["path"]=> - string(5) "/path" -} -array(3) { - ["host"]=> - string(9) "localhost" - ["port"]=> - int(80) - ["path"]=> - string(5) "/path" -} -array(2) { - ["host"]=> - string(9) "localhost" - ["path"]=> - string(5) "/path" -} -array(4) { - ["scheme"]=> - string(4) "http" - ["host"]=> - string(9) "localhost" - ["port"]=> - int(80) - ["path"]=> - string(5) "/path" -} diff --git a/ext/standard/url.c b/ext/standard/url.c index 16237e6599..d8271a18ed 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -181,10 +181,6 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length) p = e + 1; pp = p; - if (*s == '/' && *(s+1) == '/') { /* relative-scheme URL */ - s += 2; - } - while (pp-p < 6 && isdigit(*pp)) { pp++; } @@ -205,6 +201,10 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length) STR_FREE(ret->scheme); efree(ret); return NULL; + } else if (*s == '/' && *(s+1) == '/') { /* relative-scheme URL */ + s += 2; + } else { + goto just_path; } } else if (*s == '/' && *(s+1) == '/') { /* relative-scheme URL */ s += 2; |