php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45602 urlencode/urldecode should use ASCII encoding
Submitted: 2008-07-23 11:44 UTC Modified: 2010-06-21 02:13 UTC
Votes:5
Avg. Score:3.8 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: samuel at slbdata dot se Assigned:
Status: Wont fix Package: URL related
PHP Version: 6CVS-2008-07-23 (snap) OS: Ubuntu 8.04.1
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: samuel at slbdata dot se
New email:
PHP Version: OS:

 

 [2008-07-23 11:44 UTC] samuel at slbdata dot se
Description:
------------
The "URL Generic Syntax" specification (RFC 2396) says that URLs must be US-ASCII. However, the PHP urlencode/decode functions return/accept binary data only. I think the correct behaviour would be to use Unicode (which is a superset of ASCII) for the encoded values.

(This might affect some other URL-related functions, but urlencode/urldecode are the only ones that I know)

See also bug 45566 . Since it's quite likely for urldecode's input to come from the $_SERVER superglobal, I think either both or none of the bugs should be fixed.


Reproduce code:
---------------
<?php
echo urldecode("%50%48%50\n");

Expected result:
----------------
PHP

Actual result:
--------------
PHP Warning:  urldecode() expects parameter 1 to be strictly a binary string, Unicode string given in - on line 3

Warning: urldecode() expects parameter 1 to be strictly a binary string, Unicode string given in - on line 3


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-31 23:12 UTC] jani@php.net
See also bug #45566 (you missed the hash there :)
 [2010-06-21 02:13 UTC] felipe@php.net
-Status: Open +Status: Wont fix
 [2010-06-21 02:13 UTC] felipe@php.net
Old trunk related.
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC