More checking to ensure tags is an array.

This commit is contained in:
jgen 2017-05-13 23:18:47 -07:00
parent 7ebe301ffd
commit 3ffb2da91c

View file

@ -536,7 +536,8 @@ class OuroborosAPI extends Extension
if (!is_null($img)) {
$handler = $config->get_string("upload_collision_handler");
if($handler == "merge") {
$merged = array_merge(Tag::explode($post->tags), $img->get_tag_array());
$postTags = is_array($post->tags) ? $post->tags : Tag::explode($post->tags);
$merged = array_merge($postTags, $img->get_tag_array());
send_event(new TagSetEvent($img, $merged));
// This is really the only thing besides tags we should care