From 6f59de4d458fb6bea10969030b1838d064b736cd Mon Sep 17 00:00:00 2001 From: jgen Date: Sun, 23 Feb 2014 02:51:33 -0500 Subject: [PATCH] Prevent an internal server error occurring when mincount is less than 1. --- ext/tag_list/main.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/tag_list/main.php b/ext/tag_list/main.php index 161cde0d..3dc3b92d 100644 --- a/ext/tag_list/main.php +++ b/ext/tag_list/main.php @@ -281,6 +281,10 @@ class TagList extends Extension { $tags_min = $this->get_tags_min(); + // Make sure that the value of $tags_min is at least 1. + // Otherwise the database will complain if you try to do: LOG(0) + if ($tags_min < 1){ $tags_min = 1; } + // check if we have a cached version $cache_key = data_path("cache/tag_popul-" . md5("tp" . $tags_min) . ".html"); if(file_exists($cache_key)) {return file_get_contents($cache_key);}