Skip to content

Commit 31a4afc

Browse files
committed
Add comment about SQL injection consideration
1 parent b8ae995 commit 31a4afc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pgcommitfest/commitfest/views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,9 @@ def patchlist(request, cf, personalized=False):
289289
try:
290290
tag_ids = [int(t) for t in request.GET.getlist("tag")]
291291
for tag_id in tag_ids:
292+
# Instead of using parameters, we just inline the tag_id. This
293+
# is easier, and since tag_id is always an int it's safe with
294+
# respect to SQL injection.
292295
whereclauses.append(
293296
f"EXISTS (SELECT 1 FROM commitfest_patch_tags tags WHERE tags.patch_id=p.id AND tags.tag_id={tag_id})"
294297
)

0 commit comments

Comments
 (0)