#46784 [NEW]: Mixing page encodings (UTF8/ASCII) makes unrecognized session variables
| From: | simon dot uyttendaele at gmail dot com | Date: | Sat, 06 Dec 2008 14:31:10 +0000 |
| Subject: | #46784 [NEW]: Mixing page encodings (UTF8/ASCII) makes unrecognized session variables | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-131677@lists.php.net to get a copy of this message | ||
From: simon dot uyttendaele at gmail dot com
Operating system: Debian etch
PHP version: 5.2.7
PHP Bug Type: Session related
Bug description: Mixing page encodings (UTF8/ASCII) makes unrecognized session variables
Description:
------------
- Having an auto_prepend script encoded in UTF8
- One regular page encoded in ASCII
- A second page encoded in UTF8
(or the other way around)
Makes all the associative session variables unrecognized.
print_r($_SESSION) does out put the correct session variables. (the key is
probably encoded differently which makes it not recognize it)
Reproduce code:
---------------
PREPEND FILE ENCODED IN UTF8 (no BOM) :
<?php
$dummy = true;
?>
REGULAR FILE ENCODED IN ASCII :
<?php
session_start();
$_SESSION['foo'] = 42;
include( <second page> );
?>
REGULAR FILE ENCODED IN UTF8 :
<?php
echo $_SESSION['foo'];
print_r($_SESSION);
?>
Expected result:
----------------
Display :
-----------------
42Array( [foo] => 42 )
-----------------
Actual result:
--------------
Display :
-----------------
Array( [foo] => 42 )
-----------------
--
Edit bug report at http://bugs.php.net/?id=46784&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46784&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46784&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46784&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46784&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=46784&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=46784&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=46784&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=46784&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=46784&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=46784&r=support
Expected behavior: http://bugs.php.net/fix.php?id=46784&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=46784&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=46784&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46784&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46784&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46784&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=46784&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=46784&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=46784&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=46784&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=46784&r=mysqlcfg