mirror of https://github.com/zulip/zulip.git
api_subscribe: Check for too-long stream names.
(imported from commit 20d94eafeb333a9bc09b6b20093e13fd1b241ea8)
This commit is contained in:
parent
f9713d5541
commit
091bc48926
|
@ -482,6 +482,9 @@ def api_subscribe(request, user_profile):
|
|||
if "streams" not in request.POST:
|
||||
return json_error("Missing streams argument.")
|
||||
streams = simplejson.loads(request.POST.get("streams"))
|
||||
for stream_name in streams:
|
||||
if len(stream_name) > 30:
|
||||
return json_error("Stream name %s too long." % (stream_name,))
|
||||
res = add_subscriptions_backend(request, user_profile, streams)
|
||||
return json_success(res)
|
||||
|
||||
|
|
Loading…
Reference in New Issue