subs: Encode stream names before updating stream descriptions.

The API uses this endpoint /json/streams/<stream_name> 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.
This commit is contained in:
Mohsen Ibrahim 2016-10-14 09:06:14 +03:00 committed by Tim Abbott
parent 82b814a1cd
commit 74baee93fa
1 changed files with 2 additions and 0 deletions

View File

@ -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();