summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-12-10 21:13:09 +0500
committerilotterytea <iltsu@alright.party>2025-12-10 21:13:09 +0500
commit3623db728ba4edb3107abbff483d1eb9cdd53ca3 (patch)
tree08b631efb49cdf8e3dc95c0c393fbf0efb570a12
parent0ffb5175771345f5216402d854f4f240528716f5 (diff)
fix: pagination on emote search
-rw-r--r--emotes/index.php6
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"
);
}
}