Commit 8997f337 authored by jonnybradley's avatar jonnybradley

[FIX] prefs: Report unserialising errors when loading prefs, caused by a...

[FIX] prefs: Report unserialising errors when loading prefs, caused by a regression in profiles in this case
parent 88ad86f1
Pipeline #50492524 failed with stages
in 27 minutes and 47 seconds
......@@ -272,7 +272,12 @@ function initialize_prefs($force = false)
// Unserialize serialized preferences
foreach ($serializedPreferences as $serializedPreference) {
if (! empty($modified[$serializedPreference]) && ! is_array($modified[$serializedPreference])) {
$modified[$serializedPreference] = unserialize($modified[$serializedPreference]);
$unserialized = @unserialize($modified[$serializedPreference]);
if ($unserialized === false) {
Feedback::error(tr('Preference %0 failed to unserialize. Value was "%1"', $serializedPreference, $modified[$serializedPreference]));
} else {
$modified[$serializedPreference] = $unserialized;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment