mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-23 14:26:58 +00:00
Code cleanup
This commit is contained in:
@@ -70,13 +70,17 @@ class Preference extends Model
|
||||
}
|
||||
$serialized = true;
|
||||
try {
|
||||
unserialize($data);
|
||||
unserialize($data, ['allowed_classes' => false]);
|
||||
} catch (Exception $e) {
|
||||
$serialized = false;
|
||||
Log::debug(sprintf('Could not unserialise preference #%d. This is good. %s', $this->id, $e->getMessage()));
|
||||
}
|
||||
if (!$serialized) {
|
||||
$result = json_decode($data, true);
|
||||
}
|
||||
if ($serialized) {
|
||||
Log::error(sprintf('Preference #%d ("%s") was stored as serialised object. It will be deleted and recreated.', $this->id, $this->name));
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user