[php-src] Issue #7890: parse_url() and incorrect port definition
| From: | cmb69 | Date: | Thu, 06 Jan 2022 13:11:13 +0000 |
| Subject: | [php-src] Issue #7890: parse_url() and incorrect port definition | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-238814@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/7890
Comment Author: cmb69
The [documentation](https://www.php.net/parse_url) states:
> Partial and invalid URLs are also accepted, parse_url() tries its best to parse them correctly.
That best effort fails here, and in many other cases, and I don't think there is any reliable
way to correctly parse all partial URLs (except maybe for some clear and restricting definition of
"partial"). You might be better off using a [regex to
parse](https://datatracker.ietf.org/doc/html/rfc3986#appendix-B) URLs. parse_url() can't do
this for BC reasons.
IMO this is "Invalid" or "Won't fix", or maybe a feature request.