[core] don't take shortcuts when going next/prev, as some extensions (eg ratings) might want to alter search results (fixes #984)

This commit is contained in:
Shish
2023-12-31 18:48:49 +00:00
parent fcdddd6f96
commit fb49b785ef
2 changed files with 53 additions and 15 deletions

View File

@@ -166,21 +166,10 @@ class Image
$dir = "ASC";
}
if (count($tags) === 0) {
$row = $database->get_row('
SELECT images.*
FROM images
WHERE images.id '.$gtlt.' '.$this->id.'
ORDER BY images.id '.$dir.'
LIMIT 1
');
return ($row ? new Image($row) : null);
} else {
$tags[] = 'id'. $gtlt . $this->id;
$tags[] = 'order:id_'. strtolower($dir);
$images = Search::find_images(0, 1, $tags);
return (count($images) > 0) ? $images[0] : null;
}
$tags[] = 'id'. $gtlt . $this->id;
$tags[] = 'order:id_'. strtolower($dir);
$images = Search::find_images(0, 1, $tags);
return (count($images) > 0) ? $images[0] : null;
}
/**