#44860 [NEW]: session_encode fails for php_binary serialiser
| From: | ant@php.net | Date: | Tue, 29 Apr 2008 09:05:46 +0000 |
| Subject: | #44860 [NEW]: session_encode fails for php_binary serialiser | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-124574@lists.php.net to get a copy of this message | ||
From: ant@php.net
Operating system: All
PHP version: 6CVS-2008-04-29 (snap)
PHP Bug Type: Session related
Bug description: session_encode fails for php_binary serialiser
Description:
------------
I've added a new test into the 6.0 branch called
session_encode_variation7.phpt - the expected output for this test shows
the problem. It shows that when unicode is enabled the output from
session_encode when using the php_binary serialiser is wrong.
Reproduce code:
---------------
--TEST--
Test session_encode() function : variation
--SKIPIF--
<?php include('skipif.inc'); ?>
--INI--
session.serialize_handler=php_binary
--FILE--
<?php
ob_start();
/*
* Prototype : string session_encode(void)
* Description : Encodes the current session data as a string
* Source code : ext/session/session.c
*/
echo "*** Testing session_encode() : variation ***\n";
var_dump(session_start());
$_SESSION["foo"] = 1234567890;
$encoded = session_encode();
var_dump(base64_encode($encoded));
var_dump(session_destroy());
echo "Done";
ob_end_flush();
?>
--EXPECTF--
*** Testing session_encode() : variation ***
bool(true)
string(24) "A2Zvb2k6MTIzNDU2Nzg5MDs="
bool(true)
Done
--UEXPECTF--
*** Testing session_encode() : variation ***
bool(true)
string(0) ""
bool(true)
Done
Expected result:
----------------
--UEXPECTF--
*** Testing session_encode() : variation ***
bool(true)
unicode(24) "A2Zvb2k6MTIzNDU2Nzg5MDs="
bool(true)
Done
Actual result:
--------------
--UEXPECTF--
*** Testing session_encode() : variation ***
bool(true)
string(0) ""
bool(true)
Done
--
Edit bug report at http://bugs.php.net/?id=44860&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44860&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44860&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44860&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=44860&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=44860&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=44860&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=44860&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=44860&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=44860&r=support
Expected behavior: http://bugs.php.net/fix.php?id=44860&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=44860&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=44860&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=44860&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44860&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=44860&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=44860&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=44860&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=44860&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=44860&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=44860&r=mysqlcfg