forked from MarseyWorld/MarseyWorld
master
parent
52a50796a0
commit
5ade054494
|
@ -71,11 +71,7 @@ def get_account(id, v=None):
|
|||
|
||||
user = g.db.query(User).filter_by(id = id).one_or_none()
|
||||
|
||||
if not user:
|
||||
try: id = int(str(id), 36)
|
||||
except: abort(404)
|
||||
user = g.db.query(User).filter_by(id = id).one_or_none()
|
||||
if not user: abort(404)
|
||||
if not user: abort(404)
|
||||
|
||||
if v:
|
||||
block = g.db.query(UserBlock).filter(
|
||||
|
|
|
@ -34,9 +34,7 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
|
|||
if v and request.path.startswith('/logged_out'): v = None
|
||||
|
||||
try: cid = int(cid)
|
||||
except:
|
||||
try: cid = int(cid, 36)
|
||||
except: abort(404)
|
||||
except: abort(404)
|
||||
|
||||
comment = get_comment(cid, v=v)
|
||||
|
||||
|
|
|
@ -110,9 +110,7 @@ def post_id(pid, anything=None, v=None):
|
|||
|
||||
|
||||
try: pid = int(pid)
|
||||
except:
|
||||
try: pid = int(pid, 36)
|
||||
except: abort(404)
|
||||
except: abort(404)
|
||||
|
||||
post = get_post(pid, v=v)
|
||||
|
||||
|
|
|
@ -237,17 +237,11 @@ def log(v):
|
|||
def log_item(id, v):
|
||||
|
||||
try: id = int(id)
|
||||
except:
|
||||
try: id = int(id, 36)
|
||||
except: abort(404)
|
||||
except: abort(404)
|
||||
|
||||
action=g.db.query(ModAction).filter_by(id=id).one_or_none()
|
||||
|
||||
if not action:
|
||||
abort(404)
|
||||
|
||||
if request.path != action.permalink:
|
||||
return redirect(action.permalink)
|
||||
if not action: abort(404)
|
||||
|
||||
admins = [x[0] for x in g.db.query(User.username).filter(User.admin_level > 1).all()]
|
||||
|
||||
|
|
|
@ -967,9 +967,7 @@ def user_profile_uid(v, id):
|
|||
if v and request.path.startswith('/logged_out'): v = None
|
||||
|
||||
try: id = int(id)
|
||||
except:
|
||||
try: id = int(id, 36)
|
||||
except: abort(404)
|
||||
except: abort(404)
|
||||
x=get_account(id)
|
||||
return redirect(x.profile_url)
|
||||
|
||||
|
|
|
@ -138,9 +138,7 @@ def api_vote_comment(comment_id, new, v):
|
|||
new = int(new)
|
||||
|
||||
try: comment_id = int(comment_id)
|
||||
except:
|
||||
try: comment_id = int(comment_id, 36)
|
||||
except: abort(404)
|
||||
except: abort(404)
|
||||
|
||||
comment = get_comment(comment_id)
|
||||
|
||||
|
|
Loading…
Reference in New Issue