extracting only the 16 hex characters of the query string as paste ID, addressing #396
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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(
|
||||
'<div id="passwordmodal" class="modal fade" role="dialog">' +
|
||||
'<div class="modal-dialog"><div class="modal-content">' +
|
||||
|
||||
Reference in New Issue
Block a user