Bug #80114 [Opn->Ver]: parse_url does not accept URLs with port 0

From: Date: Thu, 17 Sep 2020 12:58:06 +0000
Subject: Bug #80114 [Opn->Ver]: parse_url does not accept URLs with port 0
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-229046@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80114&edit=1 ID: 80114 Updated by: cmb@php.net Reported by: gtisza at gmail dot com Summary: parse_url does not accept URLs with port 0 -Status: Open +Status: Verified Type: Bug Package: *URL Functions Operating System: Linux PHP Version: 8.0.0beta3 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2020-09-17 01:52:28] gtisza at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=80114&edit=1

« previous php.bugs (#229046) next »