Add decryption of messages to view_publicnotes - fixes #115
This commit is contained in:
7
chat.php
7
chat.php
@ -1924,6 +1924,13 @@ function view_publicnotes(){
|
||||
$query = $db->query('SELECT notes.lastedited, notes.editedby, notes.text FROM ' . PREFIX . 'notes INNER JOIN (SELECT MAX(id) AS latest FROM notes WHERE type=3 GROUP BY editedby) AS t ON t.latest = notes.id;');
|
||||
while($result = $query->fetch(PDO::FETCH_OBJ)){
|
||||
if (!empty($result->text)) {
|
||||
if(MSGENCRYPTED){
|
||||
try {
|
||||
$result->text = sodium_crypto_aead_aes256gcm_decrypt(base64_decode($result->text), null, AES_IV, ENCRYPTKEY);
|
||||
} catch (SodiumException $e){
|
||||
send_error($e->getMessage());
|
||||
}
|
||||
}
|
||||
echo '<hr>';
|
||||
printf($I['lastedited'], htmlspecialchars($result->editedby), date($dateformat, $result->lastedited));
|
||||
echo '<br>';
|
||||
|
Reference in New Issue
Block a user