Skip to content

Commit

Permalink
Remove "k:" form url to find key
Browse files Browse the repository at this point in the history
  • Loading branch information
tale-fau committed Jul 30, 2024
1 parent 68e8b51 commit 4f8bec9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ function($f3) {

$symmetricKey = "";
if (isset($_COOKIE[$hash])) {
$symmetricKey = "#k:" . $_COOKIE[$hash];
$symmetricKey = "#" . $_COOKIE[$hash];
$encryptor = new CryptographyClass($_COOKIE[$hash], $f3->get('PDF_STORAGE_PATH').$hash);
if (!$encryptor->encrypt()) {
shell_exec("rm -rf $sharingFolder");
Expand Down Expand Up @@ -355,7 +355,7 @@ function($f3) {

$symmetricKey = "";
if (isset($_COOKIE[$hash])) {
$symmetricKey = "#k:" . $_COOKIE[$hash];
$symmetricKey = "#" . $_COOKIE[$hash];
$encryptor = new CryptographyClass($_COOKIE[$hash], $f3->get('PDF_STORAGE_PATH').$hash);
$encryptor->encrypt();
}
Expand Down
6 changes: 3 additions & 3 deletions public/js/signature.js
Original file line number Diff line number Diff line change
Expand Up @@ -1170,10 +1170,10 @@ var pageSignature = async function(url) {
setTimeout(function() { runCron() }, 2000);
}
if(pdfHash) {
if (window.location.hash && window.location.hash.match(/^\#k:/)) {
storeSymmetricKeyCookie(pdfHash, window.location.hash.replace(/^#k:/, ''));
if (window.location.hash && window.location.hash.match(/^\#/)) {
storeSymmetricKeyCookie(pdfHash, window.location.hash.replace(/^#/, ''));
} else if (getSymmetricKey(pdfHash)) {
window.location.hash = 'k:' + getSymmetricKey(pdfHash);
window.location.hash = getSymmetricKey(pdfHash);
}
pageSignature('/signature/'+pdfHash+'/pdf');
window.addEventListener('hashchange', function() {
Expand Down

0 comments on commit 4f8bec9

Please sign in to comment.