From 9f893c8326328fe1e469af15231480bc7084075d Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Fri, 24 Sep 2010 11:22:11 -0400 Subject: [PATCH] Handle unserialize() failures gracefully --- ansel/lib/Gallery.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.11.0