From 9e7787de0c222fdb88489f93d6904f5c0b4b57ea Mon Sep 17 00:00:00 2001 From: jgen Date: Thu, 9 Mar 2017 22:55:32 -0800 Subject: [PATCH] From Scrutinizer: The case 'r' would never be reached due to the default appearing before it. --- ext/tag_editcloud/main.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ext/tag_editcloud/main.php b/ext/tag_editcloud/main.php index f9325aae..854893bc 100644 --- a/ext/tag_editcloud/main.php +++ b/ext/tag_editcloud/main.php @@ -83,18 +83,6 @@ class TagEditCloud extends Extension { } switch($sort_method) { - case 'a': - case 'p': - default: - $order_by = $sort_method == 'a' ? "tag" : "count DESC"; - $tag_data = $database->get_all(" - SELECT tag, FLOOR(LN(LN(count - :tag_min1 + 1)+1)*150)/200 AS scaled, count - FROM tags - WHERE count >= :tag_min2 - ORDER BY $order_by - LIMIT :limit", - array("tag_min1" => $tags_min, "tag_min2" => $tags_min, "limit" => $max_count)); - break; case 'r': $relevant_tags = array_diff($image->get_tag_array(),$ignore_tags); if(count($relevant_tags) == 0) { @@ -113,6 +101,18 @@ class TagEditCloud extends Extension { LIMIT :limit", array("tag_min1" => $tags_min, "tag_min2" => $tags_min, "limit" => $max_count)); break; + case 'a': + case 'p': + default: + $order_by = $sort_method == 'a' ? "tag" : "count DESC"; + $tag_data = $database->get_all(" + SELECT tag, FLOOR(LN(LN(count - :tag_min1 + 1)+1)*150)/200 AS scaled, count + FROM tags + WHERE count >= :tag_min2 + ORDER BY $order_by + LIMIT :limit", + array("tag_min1" => $tags_min, "tag_min2" => $tags_min, "limit" => $max_count)); + break; } $counter = 1;