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