From 7b8d2c1bb5acbd0c7f3dfa4a11d5a1923b711fa4 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 24 Aug 2015 13:14:59 +0000 Subject: [PATCH] automatic unserialize php serialized preferences on server-side, to fix not working old favorites stored php-serialized after r53433 --- phpgwapi/inc/class.preferences.inc.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/phpgwapi/inc/class.preferences.inc.php b/phpgwapi/inc/class.preferences.inc.php index bce61e1055..50ef277340 100644 --- a/phpgwapi/inc/class.preferences.inc.php +++ b/phpgwapi/inc/class.preferences.inc.php @@ -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) {