using a white-list currently only matching favorites

This commit is contained in:
Ralf Becker 2015-08-24 13:32:05 +00:00
parent b0c20d2e76
commit 5f7b671532

View File

@ -218,9 +218,11 @@ class preferences
$prefs[$row['preference_owner']][$app] = self::unserialize($row['preference_value']);
// fix old PHP serialized attribute-values
foreach($prefs[$row['preference_owner']][$app] as &$val)
foreach($prefs[$row['preference_owner']][$app] as $name => &$val)
{
if (is_string($val) && $val[0] != 'a' && $val[1] != ':' && ($v = php_safe_unserialize($val)))
if (is_string($val) && $val[0] != 'a' && $val[1] != ':' &&
// using a white-list currently only matching favorites
substr($name, 0, 9) == 'favorite_' && ($v = php_safe_unserialize($val)))
{
$val = $v;
}