Skip to content

Commit

Permalink
Escape search queries
Browse files Browse the repository at this point in the history
  • Loading branch information
rainbowdashlabs committed Jun 12, 2024
1 parent e0c35cb commit d7ee5b6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ public List<CompletedCategory> completeCategories(String value) {
FROM repository_category rc
LEFT JOIN category c ON rc.category_id = c.id
LEFT JOIN repository_meta rm ON rc.repository_id = rm.repository_id
WHERE rm.public AND category ILIKE ('%' || ? || '%')
WHERE rm.public AND category ILIKE ('%%' || ? || '%%')
LIMIT 25""";

return query(select)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/de/chojo/krile/data/access/TagData.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public List<CompletedCategory> completeCategories(String value) {
LEFT JOIN category c
ON tc.category_id = c.id
WHERE public
AND category ILIKE '%' || ? || '%'
AND category ILIKE '%%' || ? || '%%'
LIMIT 25""";
return query(select)
.single(call().bind(value))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public List<CompletedRepository> complete(String value) {
FROM guild_repository gr
LEFT JOIN repository r ON r.id = gr.repository_id
WHERE guild_id = ?
AND identifier ILIKE '%' || ? || '%'
AND identifier ILIKE '%%' || ? || '%%'
ORDER BY priority DESC
LIMIT 25""";

Expand Down

0 comments on commit d7ee5b6

Please sign in to comment.