writing test for scriptLocation function, fixing non-removed query separator bug

This commit is contained in:
El RIDO 2017-02-05 16:45:11 +01:00
parent 5442af6e20
commit 80f7baa604
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
2 changed files with 39 additions and 16 deletions

View file

@ -259,7 +259,8 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
var scriptLocation = window.location.href.substring(
0,
window.location.href.length - window.location.search.length - window.location.hash.length
), hashIndex = scriptLocation.indexOf('#');
),
hashIndex = scriptLocation.indexOf('?');
if (hashIndex !== -1)
{
scriptLocation = scriptLocation.substring(0, hashIndex);