fix 500: abort 404 if not an integer

master
justcool393 2022-10-16 02:18:23 -07:00
parent c74e8013a9
commit 3f9b51f0c1
1 changed files with 8 additions and 2 deletions

View File

@ -26,7 +26,10 @@ def upvoters_downvoters(v, username, uid, cls, vote_cls, vote_dir, template, sta
if u.is_private and (not v or (v.id != u.id and v.admin_level < PERMS['VIEW_PRIVATE_PROFILES'] and not v.eye)): abort(403)
if not (v.id == u.id or v.admin_level >= PERMS['USER_VOTERS_VISIBLE']): abort(403)
id = u.id
try:
uid = int(uid)
except:
abort(404)
page = max(1, int(request.values.get("page", 1)))
@ -73,7 +76,10 @@ def upvoting_downvoting(v, username, uid, cls, vote_cls, vote_dir, template, sta
if u.is_private and (not v or (v.id != u.id and v.admin_level < PERMS['VIEW_PRIVATE_PROFILES'] and not v.eye)): abort(403)
if not (v.id == u.id or v.admin_level >= PERMS['USER_VOTERS_VISIBLE']): abort(403)
id = u.id
try:
uid = int(uid)
except:
abort(404)
page = max(1, int(request.values.get("page", 1)))