From 08cad3ed234a2110ebdf0101854da3e1c92cd30a Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Tue, 14 Sep 2010 11:33:00 -0400 Subject: [PATCH] Short circuit if we have an empty $tag --- ansel/lib/Tagger.php | 4 ++++ ansel/lib/View/GalleryProperties.php | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) 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. -- 2.11.0