Merge pull request #745 from sanmadjack/image_count_speed_hax

Added SPEED_HAX criteria to image count shortcuts.
This commit is contained in:
Shish 2020-09-16 11:19:35 +01:00 committed by GitHub
commit d320efea3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -226,10 +226,10 @@ class Image
global $cache, $database;
$tag_count = count($tags);
if ($tag_count === 0) {
if (SPEED_HAX && $tag_count === 0) {
// total number of images in the DB
$total = self::count_total_images();
} elseif ($tag_count === 1 && !preg_match("/[:=><\*\?]/", $tags[0])) {
} elseif (SPEED_HAX && $tag_count === 1 && !preg_match("/[:=><\*\?]/", $tags[0])) {
if (!startsWith($tags[0], "-")) {
// one tag - we can look that up directly
$total = self::count_tag($tags[0]);