ID: 39078
Updated by: [EMAIL PROTECTED]
Reported By: main at springtimesoftware dot com
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: Windows XP
PHP Version: 5.1.6
New Comment:
That's why you should use urlencode().
Previous Comments:
------------------------------------------------------------------------
[2006-10-07 18:54:46] main at springtimesoftware dot com
Description:
------------
I searched the bug database, but could not find this problem
addressed.
This is a simple case using default configurations where a client
JavaScript script sends a plus sign and a space as an argument as part
of a URL to a server.
The script constructs the URL using the JavaScript 'escape' function,
as recommended:
URL='www.example.com/example.php?Arg='+escape('+ ');
The server, running Apache and PHP, automatically runs urldecode (that
is, I think it does; I could not find this documented in the PHP manual
even after I did a lot of searching).
The PHP code
$Arg=$_GET["Arg"];
receives the string as " " (two spaces) instead of the expected "+ ".
This is not a bug, but documented behavior of urldecode!
My request for a feature is this: add a runtime-accessible
configuration option to suppress any default decoding of GET, POST, and
other such arrays. Then the programmer can use rawurldecode to decode
arguments properly.
Note: Although I only mentioned plus sign and space above, I really
want to pass a string that can contain characters with any byte value,
0 to 255. This is to support cryptology protocols.
David Spector
Springtime Software
Reproduce code:
---------------
Let me know if you really need a test case. It would include a client
page and a server page.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39078&edit=1