Bug #80266 [Asn->Csd]: parse_url silently drops port number 0
| From: | cmb@php.net | Date: | Wed, 04 Nov 2020 13:59:29 +0000 |
| Subject: | Bug #80266 [Asn->Csd]: parse_url silently drops port number 0 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-230103@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80266&edit=1
ID: 80266
Updated by: cmb@php.net
Reported by: smiley at chillerlan dot net
Summary: parse_url silently drops port number 0
-Status: Assigned
+Status: Closed
Type: Bug
Package: *URL Functions
Operating System: Windows
PHP Version: 7.3.24, 7.4.12
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=2cab085bb37a6980b8f23a4b3c31b813ac67cda0
Log: Fix #80266: parse_url silently drops port number 0
Previous Comments:
------------------------------------------------------------------------
[2020-11-04 10:57:47] cmb@php.net
The following pull request has been associated:
Patch Name: Fix #80266: parse_url silently drops port number 0
On GitHub: https://github.com/php/php-src/pull/6399
Patch: https://github.com/php/php-src/pull/6399.patch
------------------------------------------------------------------------
[2020-10-27 12:50:45] cmb@php.net
> It would make more sense to include the zero port in the output
> to me.
After further consideration, I have to agree.
------------------------------------------------------------------------
[2020-10-27 11:12:46] nikic@php.net
| URIs with a 0 port are generally valid, so
parse_url() should
| recognize such URIs, but still report the port as missing.
I do wonder whether that's the right behavior. It would make more sense to include the zero
port in the output to me.
------------------------------------------------------------------------
[2020-10-21 12:41:06] smiley at chillerlan dot net
> Apparently, we should document that behavior.
Yes, that would be greatly appreciated, also a mention in UPGRADING would be helpful.
Thanks for clearing this up and thank you for your time! I think this can be closed then. Cheers!
------------------------------------------------------------------------
[2020-10-21 10:00:48] cmb@php.net
Firstly, this is not particularly related to PHP 8.0,
but rather affects PHP-7.3+.
> [â¦] in fact, you could reproduce what the Windows build of the
> GH actions runner didn't.
The GH actions runner uses PHP 7.4.11 (which does not have that
bugfix) and some PHP 8.0.0-dev version (which presumably does not
have the bugfix either).
> Aside, if this is now expected behaviour, why is the "port" key
> with a value 0 missing in the array
From the commit message:
| URIs with a 0 port are generally valid, so parse_url() should
| recognize such URIs, but still report the port as missing.
Apparently, we should document that behavior.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=80266
--
Edit this bug report at https://bugs.php.net/bug.php?id=80266&edit=1