From 2fa5021a0c6d2daa8e996f085418254a10da969a Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 1 Feb 2019 09:04:01 +0200 Subject: [PATCH] Improved `User` unserialize to not to break the object if serialized data is not what expected --- CHANGELOG.md | 7 +++++++ system/src/Grav/Common/User/User.php | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dcee0479d..1c70e1180 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# v1.5.8 +## mm/dd/2019 + +1. [](#improved) + * Improved `User` unserialize to not to break the object if serialized data is not what expected + + # v1.5.7 ## 01/25/2019 diff --git a/system/src/Grav/Common/User/User.php b/system/src/Grav/Common/User/User.php index 9cce364fd..c6f5dac27 100644 --- a/system/src/Grav/Common/User/User.php +++ b/system/src/Grav/Common/User/User.php @@ -306,6 +306,10 @@ class User extends Data $this->gettersVariable = 'items'; $this->nestedSeparator = '.'; + if (null === $this->items) { + $this->items = []; + } + if (null === $this->blueprints) { $blueprints = new Blueprints; $this->blueprints = $blueprints->get('user/account');