From: Chuck Hagenbuch Date: Fri, 24 Sep 2010 15:22:11 +0000 (-0400) Subject: Handle unserialize() failures gracefully X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=9f893c8326328fe1e469af15231480bc7084075d;p=horde.git Handle unserialize() failures gracefully --- diff --git a/ansel/lib/Gallery.php b/ansel/lib/Gallery.php index 4e6f17b59..e9274318e 100644 --- a/ansel/lib/Gallery.php +++ b/ansel/lib/Gallery.php @@ -732,7 +732,10 @@ class Ansel_Gallery extends Horde_Share_Object_Sql_Hierarchical $style = Ansel::getStyleDefinition($GLOBALS['prefs']->getValue('default_gallerystyle')); } else { // Explicitly defined style - $style = unserialize($this->data['attribute_style']); + $style = @unserialize($this->data['attribute_style']); + if (!$style) { + $style = Ansel::getStyleDefinition($GLOBALS['prefs']->getValue('default_gallerystyle')); + } } // Check browser requirements. If we require PNG support, and do not