Restore encrypted notes

send_backup() decrypts the notes if MSGENCRYPTED is enabled.
So, re-encrypt the notes on restore.
This commit is contained in:
larry_the_cow
2019-02-03 15:45:18 +00:00
parent a63901fc76
commit 4d0b828879

View File

@ -767,6 +767,9 @@ function restore_backup($C){
}elseif($note['type']==='staff'){
$note['type']=1;
}
if(MSGENCRYPTED){
$note['text']=openssl_encrypt($note['text'], 'aes-256-cbc', ENCRYPTKEY, 0, '1234567890123456');
}
$stmt->execute([$note['type'], $note['lastedited'], $note['editedby'], $note['text']]);
}
}