automatic unserialize php serialized preferences on server-side, to fix not working old favorites stored php-serialized after r53433

This commit is contained in:
Ralf Becker 2015-08-24 13:14:29 +00:00
parent 501f80fdc5
commit 0819d09ef9

View File

@ -216,6 +216,15 @@ class preferences
$app = trim($row['preference_app']);
$prefs[$row['preference_owner']][$app] = self::unserialize($row['preference_value']);
// fix old PHP serialized attribute-values
foreach($prefs[$row['preference_owner']][$app] as &$val)
{
if (is_string($val) && $val[0] != 'a' && $val[1] != ':' && ($v = php_safe_unserialize($val)))
{
$val = $v;
}
}
}
foreach($db_read as $id)
{