]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
don't try to save empty tags
authorJames Walker <walkah@walkah.net>
Wed, 28 Jul 2010 15:57:54 +0000 (11:57 -0400)
committerJames Walker <walkah@walkah.net>
Wed, 28 Jul 2010 15:57:54 +0000 (11:57 -0400)
classes/Status_network.php

index d1ca454e227c101f6a4ed61f761ba5821974917a..339f4c813b5f6d030bd59cf69c550d8ca3cb1435 100644 (file)
@@ -329,14 +329,16 @@ class Status_network extends Safe_DataObject
     {
         $this->clearTags();
         foreach ($tags as $tag) {
-            $snt = new Status_network_tag();
-            $snt->site_id = $this->site_id;
-            $snt->tag = $tag;
-            $snt->created = common_sql_now();
-
-            $id = $snt->insert();
-            if (!$id) {
-                throw new Exception(_("Unable to save tag."));
+            if (!empty($tag)) {
+                $snt = new Status_network_tag();
+                $snt->site_id = $this->site_id;
+                $snt->tag = $tag;
+                $snt->created = common_sql_now();
+                
+                $id = $snt->insert();
+                if (!$id) {
+                    throw new Exception(_("Unable to save tag."));
+                }
             }
         }