diff options
| -rw-r--r-- | emotes/index.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/emotes/index.php b/emotes/index.php index 2310e03..aae7683 100644 --- a/emotes/index.php +++ b/emotes/index.php @@ -108,8 +108,8 @@ else { array_push($emotes, Emote::from_array_with_user($row, $db)); } - $stmt = $db->prepare("SELECT COUNT(*) FROM emotes WHERE visibility = 1"); - $stmt->execute(); + $stmt = $db->prepare("SELECT COUNT(*) FROM emotes WHERE code LIKE ? AND visibility = 1"); + $stmt->execute([$sql_search]); $total_emotes = $stmt->fetch()[0]; $total_pages = ceil($total_emotes / $limit); } @@ -528,7 +528,7 @@ if (CLIENT_REQUIRES_JSON) { html_pagination( $total_pages, $page, - "/emotes?q=" . substr($search, 1, strlen($search) - 2) . "&s=$sort_by" + "/emotes?q=$search&s=$sort_by" ); } } |
