#39078 [Bgs]: Plus sign in URL arg received as space

From: Date: Sat, 07 Oct 2006 21:44:09 +0000
Subject: #39078 [Bgs]: Plus sign in URL arg received as space
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-103255@lists.php.net to get a copy of this message
ID: 39078 User updated by: main at springtimesoftware dot com Reported By: main at springtimesoftware dot com Status: Bogus Bug Type: Feature/Change Request Operating System: Windows XP PHP Version: 5.1.6 New Comment: So you are saying that this problem is definitely in Apache, not in PHP? You are saying that Apache converts plus signs into spaces? Please confirm this, it is hard to believe. David Previous Comments: ------------------------------------------------------------------------ [2006-10-07 21:39:53] tony2001@php.net PHP receives POST/GET data from Apache in decoded form, so if Javascript doesn't encode "+" sign, we can't fix it or even change it in anyway. ------------------------------------------------------------------------ [2006-10-07 21:02:10] main at springtimesoftware dot com Oops, I should have said that escape('+ ') gives '+%20'. On the PHP side, the "+" is considered an alias for " ", so the script sees " " (urldecode converts "+" into " " and "%20" into " "). I stand by the wording in the feature request. David ------------------------------------------------------------------------ [2006-10-07 20:58:17] main at springtimesoftware dot com The JavaScript escape function does not do what the urlencode function does. If it did, then escape on the JavaScript side would match urldecode on the PHP side, and this problem would not exist. If you apply escape to "+ ", you get "+ ". On the PHP side, PHP automatically applies urldecode, and you get " ". So, the problem is that plus sign does not get through to the PHP script. Is that clear now? David ------------------------------------------------------------------------ [2006-10-07 20:48:17] tony2001@php.net Javascript has escape() method exactly for that. ------------------------------------------------------------------------ [2006-10-07 20:38:38] main at springtimesoftware dot com JavaScript does not support urlencode. Perhaps if you read the bug report again? David ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/39078 -- Edit this bug report at http://bugs.php.net/?id=39078&edit=1

« previous php.bugs (#103255) next »