From 74baee93fac658962f35fcdd8ca53ce6730fe2c2 Mon Sep 17 00:00:00 2001 From: Mohsen Ibrahim Date: Fri, 14 Oct 2016 09:06:14 +0300 Subject: [PATCH] subs: Encode stream names before updating stream descriptions. The API uses this endpoint /json/streams/ to update stream information such as description, since the stream_name is part of the URI it should be encoded to escape unsafe characters. Fixes #1986. --- static/js/subs.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/static/js/subs.js b/static/js/subs.js index a7fae01787..6af28e5feb 100644 --- a/static/js/subs.js +++ b/static/js/subs.js @@ -1091,6 +1091,8 @@ $(function () { var $sub_row = $(e.target).closest('.subscription_row'); var stream_name = $sub_row.find('.subscription_name').text(); + // Stream name might contain unsafe characters so we must encode it first. + stream_name = encodeURIComponent(stream_name); var description = $sub_row.find('input[name="description"]').val(); $('#subscriptions-status').hide();