ID: 44860
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Session related
Operating System: All
PHP Version: 6CVS-2008-04-29 (snap)
New Comment:
string(0) "" ? I get another result...
*** Testing session_encode() : variation ***
bool(true)
Warning: base64_encode() expects parameter 1 to be strictly a binary
string, Unicode string given in ... on line 18
NULL
bool(true)
Previous Comments:
------------------------------------------------------------------------
[2008-04-29 09:05:46] [EMAIL PROTECTED]
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 this bug report at http://bugs.php.net/?id=44860&edit=1