summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--classes/Status_network.php18
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."));
+ }
}
}