]> granicus.if.org Git - php/commit
Fix #77423: parse_url() will deliver a wrong host to user PHP-7.2
authorChristoph M. Becker <cmbecker69@gmx.de>
Wed, 13 May 2020 07:36:52 +0000 (09:36 +0200)
committerStanislav Malyshev <stas@php.net>
Sat, 2 Jan 2021 04:08:01 +0000 (20:08 -0800)
commit2d3d72412a6734e19a38ed10f385227a6238e4a6
tree81578dce9403f80fc48d2589949b713e2e543667
parent662083fc4f3a570f5b9180e80c2ddec86a8fded8
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