Edit report at http://bugs.php.net/bug.php?id=44860&edit=1

 ID:               44860
 Updated by:       fel...@php.net
 Reported by:      a...@php.net
 Summary:          session_encode() fails for php_binary serializer
-Status:           Open
+Status:           Wont fix
 Type:             Bug
 Package:          Session related
 Operating System: *
 PHP Version:      6CVS-2008-04-29 (snap)

 New Comment:

Old trunk related.


Previous Comments:
------------------------------------------------------------------------
[2008-04-30 00:12:08] fel...@php.net

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)



------------------------------------------------------------------------
[2008-04-29 09:05:46] a...@php.net

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/bug.php?id=44860&edit=1

Reply via email to