1
Hi,
If you have a XOBJ_DTYPE_ARRAY and first assign a value using
$obj->setVar('myArray', $myArray) and retrieve it using
$myArray = $obj->getVar('myArray') XoopsObject will attempt to unserialize the array while it hasn't been serialized to begin with, since this only happens upon cleaning the var or reading it from the db. Therefore I'd like to suggest changing the following:
/kernel/object.php lines 341-343
case XOBJ_DTYPE_ARRAY:
$ret =& unserialize($ret);
break;
to
case XOBJ_DTYPE_ARRAY:
if(!is_array($ret)) {
$ret =& unserialize($ret);
}
break;
I am not sure wether this has been reported before (tried a seach but got no results) and has been fixed in 2.2 Hope this info helps in any way.
EDIT: Just checked the 2.2 source and see the problem has been resolved. This solution might still help for 2.0.13 users.