Don't attempt to create empty tags
authorMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 14 Sep 2010 15:33:25 +0000 (11:33 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Tue, 14 Sep 2010 15:34:12 +0000 (11:34 -0400)
content/lib/Tagger.php

index be0e14a..4688a3a 100644 (file)
@@ -675,6 +675,10 @@ class Content_Tagger
      */
     protected function _checkTags($tags, $create = true)
     {
+        if (empty($tags)) {
+            return array();
+        }
+
         if (!is_array($tags)) {
             $tags = array($tags);
         }
@@ -686,7 +690,7 @@ class Content_Tagger
         foreach ($tags as $tagIndex => $tag) {
             if (is_int($tag)) {
                 $tagIds[$tagIndex] = $tag;
-            } else {
+            } elseif (!empty($tag)) {
                 $tagText[$tag] = $tagIndex;
             }
         }