Remove brackets from `username_filters[]` URL

This commit is contained in:
Robin Ward 2013-09-06 15:58:54 -04:00
parent eef34eea80
commit 94917f47ed
2 changed files with 2 additions and 2 deletions

View File

@ -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'),

View File

@ -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) {