mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
VSubmitParent: validate thing type
This commit is contained in:
@@ -1083,6 +1083,9 @@ class VSubmitParent(VByName):
|
||||
fullname = fullname or fullname2
|
||||
if fullname:
|
||||
parent = VByName.run(self, fullname)
|
||||
if not isinstance(parent, (Comment, Link, Message)):
|
||||
abort(403, "forbidden")
|
||||
|
||||
if parent:
|
||||
if c.user_is_loggedin and parent.author_id in c.user.enemies:
|
||||
self.set_error(errors.USER_BLOCKED)
|
||||
|
||||
Reference in New Issue
Block a user