From: amr_hossam at hotmail dot com
Operating system: Windows NT
PHP version: 4.3.4
PHP Bug Type: *General Issues
Bug description: error encoding using base64_encode and base64_decode
Description:
------------
I wanted to encode some data to be used later through the base64_encode
and the base64_decode functions ...
I took some variables and encoded it, then when I want to decode these
data to display it, I found that it doesn't exist or can't be decoded ...
Reproduce code:
---------------
function docookie($setuid, $setusername, $setpass, $setstorynum,
$setumode, $setuorder, $setthold, $setnoscore, $setublockon, $settheme,
$setcommentmax) {
$info =
base64_encode("$setuid:$setusername:$setpass:$setstorynum:$setumode:$setuorder:$setthold:$setnoscore:$setublockon:$settheme:$setcommentmax");
}
function cookiedecode($user) {
global $user, $cookie;
$user = base64_decode($user);
$cookie = explode(":", $user);
}
Expected result:
----------------
variable $cookie[1] should contain the username entered
Actual result:
--------------
$cookie is empty .. doesn't contain any encoded or decoded data
--
Edit bug report at http://bugs.php.net/?id=28328&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28328&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28328&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28328&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28328&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28328&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28328&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28328&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28328&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28328&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28328&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28328&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28328&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28328&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28328&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28328&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28328&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28328&r=float