php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45775 url_**code functions do not encode/decode "+"'s
Submitted: 2008-08-10 01:06 UTC Modified: 2008-08-10 01:18 UTC
From: blue765d at aol dot com Assigned:
Status: Not a bug Package: Strings related
PHP Version: 5.2.6 OS: Debian Etch / Win32
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: blue765d at aol dot com
New email:
PHP Version: OS:

 

 [2008-08-10 01:06 UTC] 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.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-10 01:18 UTC] felipe@php.net
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) "++++"

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC