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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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: Fri May 24 17:01:32 2024 UTC