From 599264e1679643a66f3bc07004922a5eedbf4272 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Wed, 8 Jan 2020 19:48:42 +0100 Subject: [PATCH] partially address #556 - now comments can only be added after successfull decryption --- js/privatebin.js | 7 ++++++- tpl/bootstrap.php | 2 +- tpl/page.php | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/js/privatebin.js b/js/privatebin.js index 6031916b..dc02e8fd 100644 --- a/js/privatebin.js +++ b/js/privatebin.js @@ -4926,7 +4926,6 @@ jQuery.PrivateBin = (function($, RawDeflate) { plaintexts[i][1] ); } - DiscussionViewer.finishDiscussion(); }); } @@ -4980,6 +4979,12 @@ jQuery.PrivateBin = (function($, RawDeflate) { // we have to pass in remaining_time here TopNav.showEmailButton(paste.getTimeToLive()); } + + // only offer adding comments, after paste was successfully decrypted + if (paste.isDiscussionEnabled()) { + DiscussionViewer.finishDiscussion(); + } + }) .catch((err) => { // wait for the user to type in the password, diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php index 08c42e42..a74e767b 100644 --- a/tpl/bootstrap.php +++ b/tpl/bootstrap.php @@ -72,7 +72,7 @@ endif; ?> - + diff --git a/tpl/page.php b/tpl/page.php index f1dc8f37..865b0295 100644 --- a/tpl/page.php +++ b/tpl/page.php @@ -50,7 +50,7 @@ endif; ?> - +