#45775 [Opn->Bgs]: url_**code functions do not encode/decode "+"'s

From: Date: Sun, 10 Aug 2008 01:18:40 +0000
Subject: #45775 [Opn->Bgs]: url_**code functions do not encode/decode "+"'s
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-127843@lists.php.net to get a copy of this message
ID: 45775 Updated by: felipe@php.net Reported By: blue765d at aol dot com -Status: Open +Status: Bogus Bug Type: Strings related Operating System: Debian Etch / Win32 PHP Version: 5.2.6 New Comment: The PHP function names are 'urlencode' and 'urldecode', and both works fine. $pre = "++++"; $one = urlencode($pre); $two = urldecode($one); var_dump($one, $two); string(12) "%2B%2B%2B%2B" string(4) "++++" Previous Comments: ------------------------------------------------------------------------ [2008-08-10 01:06:59] blue765d at aol dot com Description: ------------ The 2 functions: url_encode() url_decode() Do not encode and decode pluses ("+") correctly. Reproduce code: --------------- <?php $pre = "++++"; $one = url_encode($pre); $two = url_decode($one); //Compare if ($pre==$two) echo "it worked!"; else echo "It did not work."; ?> Expected result: ---------------- it worked! Actual result: -------------- It did not work. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45775&edit=1

« previous php.bugs (#127843) next »