From b9893cbbda74639cd085d12f157fd98abcbba32a Mon Sep 17 00:00:00 2001 From: Daku Date: Tue, 17 May 2016 17:15:29 +0100 Subject: [PATCH] $_POST["tags"] isn't always set --- ext/upload/main.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ext/upload/main.php b/ext/upload/main.php index 9c7b3fa0..61c41d0f 100644 --- a/ext/upload/main.php +++ b/ext/upload/main.php @@ -238,13 +238,15 @@ class Upload extends Extension { * @return string[] */ private function tags_for_upload_slot($id) { + $post_tags = isset($_POST["tags"]) ? $_POST["tags"] : ""; + if(isset($_POST["tags$id"])) { # merge then explode, not explode then merge - else # one of the merges may create a surplus "tagme" - $tags = Tag::explode($_POST['tags'] . " " . $_POST["tags$id"]); + $tags = Tag::explode($post_tags . " " . $_POST["tags$id"]); } else { - $tags = Tag::explode($_POST['tags']); + $tags = Tag::explode($post_tags); } return $tags; }