Req #45968 [Opn->Sus]: urlencode with a safe paremeter

From: Date: Thu, 05 Nov 2020 13:07:26 +0000
Subject: Req #45968 [Opn->Sus]: urlencode with a safe paremeter
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230127@lists.php.net to get a copy of this message
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)

« previous php.bugs (#230127) next »