From 94917f47ed8d0af2233f5738c62e0b7216bcb63a Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 6 Sep 2013 15:58:54 -0400 Subject: [PATCH] Remove brackets from `username_filters[]` URL --- app/assets/javascripts/discourse/routes/discourse_location.js | 2 +- .../javascripts/discourse/routes/topic_from_params_route.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/routes/discourse_location.js b/app/assets/javascripts/discourse/routes/discourse_location.js index b567bbec2bc..b4e9042ad47 100644 --- a/app/assets/javascripts/discourse/routes/discourse_location.js +++ b/app/assets/javascripts/discourse/routes/discourse_location.js @@ -191,7 +191,7 @@ Ember.DiscourseLocation = Ember.Object.extend({ if (Em.isEmpty(params) || Em.isEmpty(Object.keys(params))) { return ""; } else { - return "?" + $.param(params).replace(/%5B/g, "[").replace(/%5D/g, "]"); + return "?" + decodeURIComponent($.param(params, true)); } }.property('queryParams'), diff --git a/app/assets/javascripts/discourse/routes/topic_from_params_route.js b/app/assets/javascripts/discourse/routes/topic_from_params_route.js index 0b8a1455e4b..429149c0dee 100644 --- a/app/assets/javascripts/discourse/routes/topic_from_params_route.js +++ b/app/assets/javascripts/discourse/routes/topic_from_params_route.js @@ -22,7 +22,7 @@ Discourse.TopicFromParamsRoute = Discourse.Route.extend({ postStream.set('bestOf', Em.get(queryParams, 'filter') === 'best_of'); // Set any username filters on the postStream - var userFilters = Em.get(queryParams, 'username_filters[]'); + var userFilters = Em.get(queryParams, 'username_filters') || Em.get(queryParams, 'username_filters[]'); if (userFilters) { if (typeof userFilters === "string") { userFilters = [userFilters]; } userFilters.forEach(function (username) {