php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79110 php_raw_url_encode encodes only _-.~ chars (under any EBCDIC-aware OS)
Submitted: 2020-01-13 14:51 UTC Modified: 2021-07-02 15:29 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: a at ustimen dot co Assigned: cmb (profile)
Status: Wont fix Package: *URL Functions
PHP Version: Irrelevant OS: Any EBCDIC-aware
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: a at ustimen dot co
New email:
PHP Version: OS:

 

 [2020-01-13 14:51 UTC] 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 />"


Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-13 15:55 UTC] cmb@php.net
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>
 [2021-07-02 15:29 UTC] cmb@php.net
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: cmb
 [2021-07-02 15:29 UTC] cmb@php.net
And given that EBCDIC support is removed as of PHP 8.0.0, it
wouldn't make sense to fix this.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Sep 07 23:01:27 2024 UTC