From f1df27f46ccd36470db933cab5ad11fd5171034c Mon Sep 17 00:00:00 2001 From: El RIDO Date: Sun, 29 Jan 2017 15:09:57 +0100 Subject: [PATCH] allowing for parameter strings starting with & --- js/privatebin.js | 6 +++--- js/test.js | 2 +- tpl/bootstrap.php | 2 +- tpl/page.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/js/privatebin.js b/js/privatebin.js index e8ba71f9..c80cd3eb 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -115,9 +115,9 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) { { var parameterHash = {}; var parameterArray = parameterString.split('&'); - if (parameterArray[0] != '') { - for (var i = 0; i < parameterArray.length; i++) - { + for (var i = 0; i < parameterArray.length; i++) + { + if (parameterArray[i] != '') { var pair = parameterArray[i].split('='); var key = decodeURIComponent(pair[0]); var value = decodeURIComponent(pair[1]); diff --git a/js/test.js b/js/test.js index 399a8566..5208fd3d 100644 --- a/js/test.js +++ b/js/test.js @@ -4,7 +4,7 @@ var jsc = require('jsverify'); before(function () { this.jsdom = require('jsdom-global')(); global.$ = global.jQuery = require('./jquery-3.1.1'); - global.sjcl = require('./sjcl-1.0.4'); + global.sjcl = require('./sjcl-1.0.6'); global.Base64 = require('./base64-2.1.9'); global.RawDeflate = require('./rawdeflate-0.5'); require('./rawinflate-0.3'); diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index d875b207..a29324b5 100644 --- a/tpl/bootstrap.php +++ b/tpl/bootstrap.php @@ -69,7 +69,7 @@ if ($MARKDOWN): - + diff --git a/tpl/page.php b/tpl/page.php index d63dc09b..9ab9d59e 100644 --- a/tpl/page.php +++ b/tpl/page.php @@ -47,7 +47,7 @@ if ($MARKDOWN): - +