Bug #79110 [Opn]: php_raw_url_encode encodes only _-.~ chars (under any EBCDIC-aware OS)
| From: | cmb@php.net | Date: | Fri, 13 Nov 2020 15:55:09 +0000 |
| Subject: | Bug #79110 [Opn]: php_raw_url_encode encodes only _-.~ chars (under any EBCDIC-aware OS) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-230336@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79110&edit=1
ID: 79110
Updated by: cmb@php.net
Reported by: a at ustimen dot co
Summary: php_raw_url_encode encodes only _-.~ chars (under
any EBCDIC-aware OS)
Status: Open
Type: Bug
Package: *URL Functions
Operating System: Any EBCDIC-aware
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
It seems to me the bug is more than 50 years old. ;) Anyway, as
of PHP 8.0.0, EBCDIC is no longer supported:
<https://github.com/php/php-src/blob/f5be0e5110ff816d2ce168c154cb3575d08e3cad/UPGRADING#L1136>
Previous Comments:
------------------------------------------------------------------------
[2020-01-13 14:51:36] a at ustimen dot co
Description:
------------
https://github.com/php/php-src/blob/8ee04946f0d80ad6c77e707e36f53939e3932c7d/ext/standard/url.c#L586
Bug is 21 years old.
- if (!isalnum(c) && strchr("_-.~", c) != NULL) {
+ if (!isalnum(c) && strchr("_-.~", c) == NULL) {
Test script:
---------------
# Compile PHP under not CHARSET_EBCDIC
# Run php -r 'var_dump(rawurlencode("<tag-here />"));'
Command line code:1:
string(20) "%3Ctag-here%20%2F%3E"
# Compile PHP under CHARSET_EBCDIC
# Run php -r 'var_dump(rawurlencode("<tag-here />"));'
# It ALSO should output:
Command line code:1:
string(20) "%3Ctag-here%20%2F%3E"
# But I propose it will output:
Command line code:1:
string(14) "<tag%2dhere />"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79110&edit=1