From: Joshua Rüsweg Date: Sun, 10 Jun 2018 12:30:21 +0000 (+0200) Subject: Fix strict type for unserialize X-Git-Tag: 5.2.0_Alpha_1~364^2~101^2~89 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=41abef8c30ea91a93b4903485e35f866842e4232;p=GitHub%2FWoltLab%2FWCF.git Fix strict type for unserialize See #2508 --- diff --git a/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php b/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php index c569d7315f..903ce67ec5 100644 --- a/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php +++ b/wcfsetup/install/files/lib/system/reaction/ReactionHandler.class.php @@ -339,7 +339,14 @@ class ReactionHandler extends SingletonFactory { $likes = $likeObject->likes; $dislikes = $likeObject->dislikes; $cumulativeLikes = $likeObject->cumulativeLikes; - $cachedReactions = @unserialize($likeObject->cachedReactions); + + if ($likeObject->cachedReactions !== null) { + $cachedReactions = @unserialize($likeObject->cachedReactions); + } + else { + $cachedReactions = []; + } + if (!is_array($cachedReactions)) { $cachedReactions = []; }