forked from extern/egroupware
port Christian Binders patch to handle config values as well (e.g.:customfields): little helper for prefs if unserialize failed - this can happen if the pref comes from an installation with another charset than the current system charset
This commit is contained in:
parent
0a4c2614a5
commit
a49344abf1
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user