diff options
author | James Walker <walkah@walkah.net> | 2010-07-28 11:57:54 -0400 |
---|---|---|
committer | James Walker <walkah@walkah.net> | 2010-07-28 11:57:54 -0400 |
commit | 29b8a6a18f67de74fb6adb9e91c10e7d1577c067 (patch) | |
tree | af0c08a7d1c91ad5566ef0cefdab98ef880abe44 | |
parent | 4853b1e2a029a844d0c92e6ad5f2a9e8c51b785c (diff) |
don't try to save empty tags
-rw-r--r-- | classes/Status_network.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/classes/Status_network.php b/classes/Status_network.php index d1ca454e2..339f4c813 100644 --- a/classes/Status_network.php +++ b/classes/Status_network.php @@ -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.")); + } } } |