We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 73f4762a authored by Evan Prodromou's avatar Evan Prodromou

Don't serialize protected attrs

parent 3fd6b9d4
......@@ -2407,4 +2407,22 @@ class Notice extends Memcached_DataObject
}
return $this->_original;
}
/**
* Magic function called at serialize() time.
*
* We use this to drop a couple process-specific references
* from DB_DataObject which can cause trouble in future
* processes.
*
* @return array of variable names to include in serialization.
*/
function __sleep()
{
$vars = parent::__sleep();
$skip = array('_original', '_profile');
return array_diff($vars, $skip);
}
}
......@@ -1353,4 +1353,21 @@ class Profile extends Memcached_DataObject
}
return $profile;
}
/**
* Magic function called at serialize() time.
*
* We use this to drop a couple process-specific references
* from DB_DataObject which can cause trouble in future
* processes.
*
* @return array of variable names to include in serialization.
*/
function __sleep()
{
$vars = parent::__sleep();
$skip = array('_user');
return array_diff($vars, $skip);
}
}
......@@ -983,4 +983,21 @@ class User extends Memcached_DataObject
return $apps;
}
/**
* Magic function called at serialize() time.
*
* We use this to drop a couple process-specific references
* from DB_DataObject which can cause trouble in future
* processes.
*
* @return array of variable names to include in serialization.
*/
function __sleep()
{
$vars = parent::__sleep();
$skip = array('_profile');
return array_diff($vars, $skip);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment