]> granicus.if.org Git - php/commit
Fix #77423: parse_url() will deliver a wrong host to user
authorChristoph M. Becker <cmbecker69@gmx.de>
Wed, 13 May 2020 07:36:52 +0000 (09:36 +0200)
committerStanislav Malyshev <stas@php.net>
Mon, 4 Jan 2021 09:20:21 +0000 (01:20 -0800)
commit5174de7cd33c3d4fa591c9c93859ff9989b07e8c
tree3257094e9c11847d328db1de18b7cda6b11f4053
parent9bf43c45908433d382f0499d529849172d0d8206
Fix #77423: parse_url() will deliver a wrong host to user

To avoid that `parse_url()` returns an erroneous host, which would be
valid for `FILTER_VALIDATE_URL`, we make sure that only userinfo which
is valid according to RFC 3986 is treated as such.

For consistency with the existing url parsing code, we use ctype
functions, although that is not necessarily correct.
ext/standard/tests/strings/url_t.phpt
ext/standard/tests/url/bug77423.phpt [new file with mode: 0644]
ext/standard/tests/url/parse_url_basic_001.phpt
ext/standard/tests/url/parse_url_basic_003.phpt
ext/standard/tests/url/parse_url_basic_005.phpt
ext/standard/tests/url/parse_url_unterminated.phpt
ext/standard/url.c