Просмотр исходного кода

ensure burn after reading and status messages are only changed after a successfull decryption

El RIDO 9 лет назад
Родитель
Сommit
ee43557a4f
3 измененных файлов с 14 добавлено и 15 удалено
  1. 12 13
      js/privatebin.js
  2. 1 1
      tpl/bootstrap.php
  3. 1 1
      tpl/page.php

+ 12 - 13
js/privatebin.js

@@ -3764,26 +3764,25 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
                 } else {
                 } else {
                     decryptPaste(paste, key, password);
                     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) {
             } catch(err) {
                 Alert.hideLoading();
                 Alert.hideLoading();
 
 
                 // log and show error
                 // log and show error
                 console.error(err);
                 console.error(err);
                 Alert.showError('Could not decrypt data (Wrong key?)');
                 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();
         }
         }
 
 
         /**
         /**

+ 1 - 1
tpl/bootstrap.php

@@ -69,7 +69,7 @@ if ($MARKDOWN):
 <?php
 <?php
 endif;
 endif;
 ?>
 ?>
-		<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-LYpK88nUEIgIruOud+YW0LKt+V+PVZZ1OEuO6SF49Yo6Dl0q/DCjJlHQ+RhSgkuexdSnpE9+ira9GJ1wih+e5A==" crossorigin="anonymous"></script>
+		<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-hGJxoiUhU8ByJ5Q8QsnfUzrb202C8og2STIg8P/y+ZgEo7zUOZSSRvH9JT6p9TnEmgulqaLOZ16sQBBpLaTdpQ==" crossorigin="anonymous"></script>
 		<!--[if lt IE 10]>
 		<!--[if lt IE 10]>
 		<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
 		<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
 		<![endif]-->
 		<![endif]-->

+ 1 - 1
tpl/page.php

@@ -47,7 +47,7 @@ if ($MARKDOWN):
 <?php
 <?php
 endif;
 endif;
 ?>
 ?>
-		<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-LYpK88nUEIgIruOud+YW0LKt+V+PVZZ1OEuO6SF49Yo6Dl0q/DCjJlHQ+RhSgkuexdSnpE9+ira9GJ1wih+e5A==" crossorigin="anonymous"></script>
+		<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-hGJxoiUhU8ByJ5Q8QsnfUzrb202C8og2STIg8P/y+ZgEo7zUOZSSRvH9JT6p9TnEmgulqaLOZ16sQBBpLaTdpQ==" crossorigin="anonymous"></script>
 		<!--[if lt IE 10]>
 		<!--[if lt IE 10]>
 		<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
 		<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
 		<![endif]-->
 		<![endif]-->