From 2a00b0e973ca6f2d04482f037afda5bc7a22b6b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 19 May 2020 17:42:44 -0400 Subject: [PATCH] fix: utils.params({url: ''}) --- public/src/utils.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/public/src/utils.js b/public/src/utils.js index b71c9dda48..47fd4f9a73 100644 --- a/public/src/utils.js +++ b/public/src/utils.js @@ -661,17 +661,21 @@ // get all the url params in a single key/value hash params: function (options) { - var a; var hash = {}; - var params; options = options || {}; options.skipToType = options.skipToType || {}; - if (options.url) { - a = utils.urlToLocation(options.url); + var searchStr = window.location.search; + if (options.hasOwnProperty('url')) { + if (options.url) { + var a = utils.urlToLocation(options.url); + searchStr = a ? a.search : ''; + } else { + searchStr = ''; + } } - params = (a ? a.search : window.location.search).substring(1).split('&'); + var params = searchStr.substring(1).split('&'); params.forEach(function (param) { var val = param.split('=');