forked from GNUsocial/gnu-social
don't try to save empty tags
This commit is contained in:
parent
4853b1e2a0
commit
29b8a6a18f
@ -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();
|
||||
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."));
|
||||
$id = $snt->insert();
|
||||
if (!$id) {
|
||||
throw new Exception(_("Unable to save tag."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user