diff --git a/public/src/client/category.js b/public/src/client/category.js index b9ab5bc800..2dccb5f85d 100644 --- a/public/src/client/category.js +++ b/public/src/client/category.js @@ -339,7 +339,7 @@ define('forum/category', [ infinitescroll.loadMore('categories.loadMore', { cid: ajaxify.variables.get('category_id'), after: after, - author: utils.getQueryParams().author + author: utils.params().author }, function (data, done) { if (data.topics && data.topics.length) { diff --git a/public/src/client/search.js b/public/src/client/search.js index 0af3d56be2..56bdaf6dca 100644 --- a/public/src/client/search.js +++ b/public/src/client/search.js @@ -80,8 +80,8 @@ define('forum/search', ['search', 'autocomplete'], function(searchModule, autoco $('#posted-by-user').val(params.by); } - if ((params['categories[]'] || params.categories)) { - $('#posted-in-categories').val(params['categories[]'] || params.categories); + if (params.categories) { + $('#posted-in-categories').val(params.categories); } if (params.searchChildren) { diff --git a/public/src/utils.js b/public/src/utils.js index 9c46e3fb6a..f345ab2a22 100644 --- a/public/src/utils.js +++ b/public/src/utils.js @@ -270,9 +270,12 @@ value = options.skipToType[key] ? decodeURI(val[1]) : utils.toType(decodeURI(val[1])); if (key) { + if (key.substr(-2, 2) === '[]') { + key = key.slice(0, -2); + } if (!hash[key]) { hash[key] = value; - } else { + } else { if (!$.isArray(hash[key])) { hash[key] = [hash[key]]; } @@ -293,24 +296,6 @@ return a; }, - getQueryParams: function() { - var search = window.location.search.slice(1), - data = {}; - - search = search.split('&'); - for(var x=0,numParams=search.length,temp;x