#37578 [NEW]: unserialize_callback_func in htaccess has no effect
| From: | tacker@php.net | Date: | Wed, 24 May 2006 13:32:45 +0000 |
| Subject: | #37578 [NEW]: unserialize_callback_func in htaccess has no effect | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-97508@lists.php.net to get a copy of this message | ||
From: tacker@php.net
Operating system: Gentoo Linux
PHP version: 5.1.4
PHP Bug Type: Class/Object related
Bug description: unserialize_callback_func in htaccess has no effect
Description:
------------
Using unserialize_callback_func in a htaccess has no effect. The required
classes do not get loaded.
Reproduce code:
---------------
** .htacces
php_value unserialize_callback_func "myCallBack"
php_flag session.auto_start On
** index.php
<?php
function __autoload($class)
{
require_once './' . $class . '.php';
}
function myCallBack($class)
{
__autoload($class);
}
if (isset($_GET['kill'])) {
session_destroy();
session_start();
}
echo '<pre>';
echo 'unserialize_callback_func: ' .
ini_get('unserialize_callback_func') . "\n";
echo '$_SESSION: ' . "\n";
print_r($_SESSION);
if (!isset($_SESSION['test'])) {
$_SESSION['test'] = new MyClass;
echo 'Created a ' . get_class($_SESSION['test']) . "\n";
echo '$_SESSION: ' . "\n";
print_r($_SESSION);
}
echo '<p><a href="?kill=true">Kill session</a></p>';
echo '<p><a href="' . $_SERVER['PHP_SELF'] .
'">Reload</a></p>';
echo '</pre>';
?>
** MyClass.php
<?php
class MyClass
{
public $test = 'TestValue';
}
?>
Expected result:
----------------
During unserialization myCallBack should be called and a complete MyClass
object should exist.
$_SESSION = Array
(
[test] => MyClass Object
(
[test] => TestValue
)
)
Actual result:
--------------
$_SESSION = Array
(
[test] => __PHP_Incomplete_Class Object
(
[__PHP_Incomplete_Class_Name] => MyClass
[test] => TestValue
)
)
--
Edit bug report at http://bugs.php.net/?id=37578&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37578&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37578&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37578&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=37578&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=37578&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=37578&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=37578&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=37578&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=37578&r=support
Expected behavior: http://bugs.php.net/fix.php?id=37578&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=37578&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=37578&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=37578&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37578&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=37578&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=37578&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=37578&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=37578&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=37578&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=37578&r=mysqlcfg