From ee43557a4fc81c239801721c3214175c8d58dca7 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Mon, 13 Mar 2017 19:30:44 +0100 Subject: [PATCH] ensure burn after reading and status messages are only changed after a successfull decryption --- js/privatebin.js | 25 ++++++++++++------------- tpl/bootstrap.php | 2 +- tpl/page.php | 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/js/privatebin.js b/js/privatebin.js index 7eaf15b..d77f3c2 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -3764,26 +3764,25 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) { } else { decryptPaste(paste, key, password); } + + + // shows the remaining time (until) deletion + PasteStatus.showRemainingTime(paste.meta); + + // if the discussion is opened on this paste, display it + if (paste.meta.opendiscussion) { + decryptComments(paste, key, password); + } + + Alert.hideLoading(); + TopNav.showViewButtons(); } catch(err) { Alert.hideLoading(); // log and show error console.error(err); Alert.showError('Could not decrypt data (Wrong key?)'); - - // still go on to potentially show potentially partially decrypted data } - - // shows the remaining time (until) deletion - PasteStatus.showRemainingTime(paste.meta); - - // if the discussion is opened on this paste, display it - if (paste.meta.opendiscussion) { - decryptComments(paste, key, password); - } - - Alert.hideLoading(); - TopNav.showViewButtons(); } /** diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index 28bfc93..dfd5aef 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 4b55d76..0cdaf88 100644 --- a/tpl/page.php +++ b/tpl/page.php @@ -47,7 +47,7 @@ if ($MARKDOWN): - +