diff --git a/phpgwapi/inc/class.config.inc.php b/phpgwapi/inc/class.config.inc.php index 42a04ab9eb..a473da2a97 100755 --- a/phpgwapi/inc/class.config.inc.php +++ b/phpgwapi/inc/class.config.inc.php @@ -218,6 +218,11 @@ class config $value = $row['config_value']; $test = @unserialize($value); + if($test === false) + { + // manually retrieve the string lengths of the serialized array if unserialize failed + $test = @unserialize(preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.mb_strlen('$2','8bit').':\"$2\";'", $value)); + } $config[$name] = is_array($test) ? $test : $value; } diff --git a/phpgwapi/inc/class.preferences.inc.php b/phpgwapi/inc/class.preferences.inc.php index f0cb369edd..1c97704a2a 100644 --- a/phpgwapi/inc/class.preferences.inc.php +++ b/phpgwapi/inc/class.preferences.inc.php @@ -272,6 +272,11 @@ class preferences // The following replacement is required for PostgreSQL to work $app = trim($row['preference_app']); $value = unserialize($row['preference_value']); + if($value === false) + { + // manually retrieve the string lengths of the serialized array if unserialize failed + $value = unserialize(preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.mb_strlen('$2','8bit').':\"$2\";'", $row['preference_value'])); + } $this->unquote($value); if (!is_array($value)) {