|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #45968 urlencode with a safe paremeter
Submitted: 2008-09-02 07:58 UTC Modified: 2020-11-05 13:07 UTC
Avg. Score:2.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: info at marcel-schlesinger dot de Assigned:
Status: Suspended Package: URL related
PHP Version: 6CVS-2008-09-02 (snap) OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
36 - 35 = ?
Subscribe to this entry?

 [2008-09-02 07:58 UTC] info at marcel-schlesinger dot de
I looked myself and determined that the RFC3986 is very spongelike. Compared with other programming languages I noticed that everyone differently converts the RFC.
In Python there is a nice feature, that you can tell wich chars have to be safe urllib.quote(s, safe='~'). All chars except this one in the safe parameter are escaped.
With PHP you could do this only with a search & replace function which isn't very nice.
So i want to suggest, to add likewise one more parameter to the urlencode function.

Expected result:
echo urlencode("Test str \"'.-/", array('\'', '"'));



echo rawurlencode("Test str \"'.-/", array('\'', '"'));


Actual result:
echo urlencode("Test str \"'.-/");



echo rawurlencode("Test str \"'.-/");



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-31 00:28 UTC]
-Package: Feature/Change Request +Package: URL related
 [2020-11-05 13:07 UTC]
-Status: Open +Status: Suspended
 [2020-11-05 13:07 UTC]
Given that this can be implemented in userland, this feature
request requires discussion for which this bug tracker is not
suitable.  If you, or anybody else, is still interested in having
this feature, please forward the request to the internals mailing
list[1].  For the time being, I'm suspending this ticket.

[1] <>
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Aug 13 21:05:45 2022 UTC