Req #45968 [Opn->Sus]: urlencode with a safe paremeter
Edit report at https://bugs.php.net/bug.php?id=45968&edit=1
ID: 45968
Updated by: cmb@php.net
Reported by: info at marcel-schlesinger dot de
Summary: urlencode with a safe paremeter
-Status: Open
+Status: Suspended
Type: Feature/Change Request
Package: URL related
PHP Version: 6CVS-2008-09-02 (snap)
Block user comment: N
Private report: N
New Comment:
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] <https://www.php.net/mailing-lists.php#internals>
Previous Comments:
------------------------------------------------------------------------
[2008-09-02 07:58:11] info at marcel-schlesinger dot de
Description:
------------
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('\'',
'"'));
output:
Test+str+"'%2E%2D%2F
======
echo rawurlencode("Test str \"'.-/", array('\'',
'"'));
output:
Test%20str%20"'%2E%2D%2F
Actual result:
--------------
echo urlencode("Test str \"'.-/");
output:
Test+str+%22%27.-%2F
======
echo rawurlencode("Test str \"'.-/");
output:
Test%20str%20%22%27.-%2F
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=45968&edit=1
Thread (2 messages)