|  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
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 Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: a at ustimen dot co
New email:
PHP Version: OS:


 [2020-01-13 14:51 UTC] a at ustimen dot co

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 />"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-13 15:55 UTC]
It seems to me the bug is more than 50 years old. ;)  Anyway, as
of PHP 8.0.0, EBCDIC is no longer supported:
 [2021-07-02 15:29 UTC]
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: cmb
 [2021-07-02 15:29 UTC]
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: Sun Feb 25 09:01:26 2024 UTC