add_subscriptions_backend: Check that the argument is a list.

(imported from commit c514dab9fb28dcdaa12b38e7ef028e177f4377fb)
This commit is contained in:
Tim Abbott 2012-11-16 16:27:28 -05:00
parent f5ccde78e3
commit f1ccf44c99
1 changed files with 3 additions and 0 deletions

View File

@ -735,6 +735,9 @@ def json_add_subscriptions(request, user_profile):
@has_request_variables @has_request_variables
def add_subscriptions_backend(request, user_profile, def add_subscriptions_backend(request, user_profile,
streams_raw = POST('subscriptions', simplejson.loads)): streams_raw = POST('subscriptions', simplejson.loads)):
if not isinstance(streams_raw, list):
return json_error("'subscriptions' argument must be a list")
streams = [] streams = []
for stream_name in streams_raw: for stream_name in streams_raw:
stream_name = stream_name.strip() stream_name = stream_name.strip()