$_POST["tags"] isn't always set

This commit is contained in:
Daku 2016-05-17 17:15:29 +01:00
parent caed53de6a
commit b9893cbbda

View File

@ -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;
}