diff options
Diffstat (limited to 'lib/blog/edit.php')
-rw-r--r-- | lib/blog/edit.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/blog/edit.php b/lib/blog/edit.php index d76781c..2c87bde 100644 --- a/lib/blog/edit.php +++ b/lib/blog/edit.php @@ -30,11 +30,12 @@ if (isset($_POST['title']) && isset($_POST['tags']) && isset($_POST['text'])) { " WHERE id = $postid"); sql("DELETE FROM blog_tags WHERE post = $postid"); $tags = explode(' ', $post_tags); - if (count($tags) == 1 && $tags[0] == "") { + if ($post_tags == "") { //do nothing lol } else if (count($tags) >= 1) { $v = array(); foreach ($tags as $tag) { + if ($tag == "") continue; $v[] = "($postid, '" . escs($tag) . "')"; } sql("INSERT INTO blog_tags(post, tag) VALUES " . implode(',', $v)); |