From e1e2c07f2b11c27d3fa040a9b406e4f3adf9d17b Mon Sep 17 00:00:00 2001 From: Lapo Luchini Date: Wed, 28 May 2014 16:09:22 +0200 Subject: [PATCH] `getUrlParameter` fixes as in http://stackoverflow.com/a/8764051/166524 --- pinry/static/js/helpers.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pinry/static/js/helpers.js b/pinry/static/js/helpers.js index e82f1a0..33e95e8 100644 --- a/pinry/static/js/helpers.js +++ b/pinry/static/js/helpers.js @@ -56,9 +56,5 @@ function postPinData(data) { function getUrlParameter(name) { - var decode = decodeURI( - (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1] - ); - if (decode == 'null') return null; - else return decode; + return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null; }