diff --git a/js/privatebin.js b/js/privatebin.js index 57eb273f..08aea83b 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -745,7 +745,7 @@ jQuery.PrivateBin = (function($, sjcl, Base64, RawDeflate) { { if (id === null) { // Attention: This also returns the delete token inside of the ID, if it is specified - id = window.location.search.substring(1); + id = (window.location.search.match(/[a-z0-9]{16}/) || [''])[0]; if (id === '') { throw 'no paste id given'; diff --git a/js/test/Prompt.js b/js/test/Prompt.js index 0e65b252..038f7a04 100644 --- a/js/test/Prompt.js +++ b/js/test/Prompt.js @@ -16,7 +16,7 @@ describe('Prompt', function () { 'string', function (password) { password = password.replace(/\r+/g, ''); - var clean = jsdom('', {url: 'ftp://example.com/?0'}); + var clean = jsdom('', {url: 'ftp://example.com/?0000000000000000'}); $('body').html( '