[tag_history] prevent tag aliasing for correctness and huge performance improvement

This commit is contained in:
discomrade 2024-06-16 14:43:25 +00:00 committed by Shish
parent f50795029a
commit d8505f4469

View file

@ -135,9 +135,9 @@ class TagHistoryTheme extends Themelet
$th = new TagHistory(); $th = new TagHistory();
$pt = $th->get_previous_tags($image_id, $current_id); $pt = $th->get_previous_tags($image_id, $current_id);
if ($pt) { if ($pt) {
$previous_tags = Tag::explode($pt["tags"]); $previous_tags = explode(" ", $pt["tags"]);
} }
$current_tags = Tag::explode($current_tags); $current_tags = explode(" ", $current_tags);
if ($pt) { if ($pt) {
$tags = array_unique(array_merge($current_tags, $previous_tags)); $tags = array_unique(array_merge($current_tags, $previous_tags));
sort($tags); sort($tags);