mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 00:07:57 -05:00
reddit: Add missing length check on friend and banning note fields.
This commit is contained in:
@@ -810,6 +810,8 @@ class ApiController(RedditController, OAuth2ResourceController):
|
||||
friend = VExistingUname('name'),
|
||||
note = VLength('note', 300))
|
||||
def POST_friendnote(self, form, jquery, friend, note):
|
||||
if form.has_errors("note", errors.TOO_LONG):
|
||||
return
|
||||
c.user.add_friend_note(friend, note)
|
||||
form.set_html('.status', _("saved"))
|
||||
|
||||
@@ -817,6 +819,8 @@ class ApiController(RedditController, OAuth2ResourceController):
|
||||
user = VExistingUname('name'),
|
||||
note = VLength('note', 300))
|
||||
def POST_relnote(self, form, jquery, type, user, note):
|
||||
if form.has_errors("note", errors.TOO_LONG):
|
||||
return
|
||||
c.site.add_rel_note(type[:-4], user, note)
|
||||
form.set_html('.status', _("saved"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user