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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

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: Mon Dec 30 14:01:28 2024 UTC