From: Michael J. Rubinsky Date: Tue, 14 Sep 2010 15:33:00 +0000 (-0400) Subject: Short circuit if we have an empty $tag X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=08cad3ed234a2110ebdf0101854da3e1c92cd30a;p=horde.git Short circuit if we have an empty $tag --- diff --git a/ansel/lib/Tagger.php b/ansel/lib/Tagger.php index f4c90cf23..bd754bd10 100644 --- a/ansel/lib/Tagger.php +++ b/ansel/lib/Tagger.php @@ -71,6 +71,10 @@ class Ansel_Tagger */ public function tag($localId, $tags, $owner, $content_type = 'image') { + if (empty($tags)) { + return; + } + if (!is_array($tags)) { $tags = $this->_tagger->splitTags($tags); } diff --git a/ansel/lib/View/GalleryProperties.php b/ansel/lib/View/GalleryProperties.php index 6ed9ba666..6851cf5bb 100644 --- a/ansel/lib/View/GalleryProperties.php +++ b/ansel/lib/View/GalleryProperties.php @@ -252,7 +252,7 @@ class Ansel_View_GalleryProperties $gallery->set('name', $gallery_name); } $gallery->set('desc', $gallery_desc); - $gallery->setTags(explode(',', $gallery_tags)); + $gallery->setTags(!empty($gallery_tags) ? explode(',', $gallery_tags) : ''); //$gallery->set('style', $style); $gallery->set('slug', $gallery_slug); $gallery->set('age', $gallery_age); @@ -318,7 +318,6 @@ class Ansel_View_GalleryProperties 'horde.warning'); $actionId = 'add'; $title = _("Adding A New Gallery"); - break; } // Create the new gallery.