1
Antoine
XOBJ_DTYPE_ARRAY problems in Xoops 2.0.13 and suggested fix
  • 2005/8/4 8:31

  • Antoine

  • Friend of XOOPS

  • Posts: 112

  • Since: 2004/11/14


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.

Login

Who's Online

289 user(s) are online (168 user(s) are browsing Support Forums)


Members: 0


Guests: 289


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits