Bug #80114 [NEW]: parse_url does not accept URLs with port 0
| From: | gtisza at gmail dot com | Date: | Thu, 17 Sep 2020 01:52:28 +0000 |
| Subject: | Bug #80114 [NEW]: parse_url does not accept URLs with port 0 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-229034@lists.php.net to get a copy of this message | ||
From: gtisza at gmail dot com
Operating system: Linux
PHP version: 8.0.0beta3
Package: *URL Functions
Bug Type: Bug
Bug description:parse_url does not accept URLs with port 0
Description:
------------
parse_url fails to parse URLs with port 0 (like https://example.com:0/).
While 0 is not a valid port, it is possible to send requests to it, and
URLs with a zero port can be used for all kinds of purposes ( the URI
itself is valid per https://tools.ietf.org/html/rfc3986#section-3.2.3
).
At a minimum, if this is an intentional constraint, it should be
documented.
Test case: https://3v4l.org/36TqT
Affects all PHP versions starting with 5.3.6 (before it was parsed as
expected).
See also #62159.
Test script:
---------------
var_dump( parse_url('https://example.com:1/')
);
var_dump( parse_url('https://example.com:0/')
);
--
Edit bug report at https://bugs.php.net/bug.php?id=80114&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80114&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80114&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80114&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80114&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80114&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80114&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80114&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80114&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80114&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80114&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80114&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80114&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80114&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80114&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80114&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80114&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80114&r=mysqlcfg