Fix deprecation notices

This commit is contained in:
Miraty 2023-02-07 22:25:16 +01:00
parent ac6d311ada
commit ad98060f9e
3 changed files with 3 additions and 3 deletions

View File

@ -67,7 +67,7 @@ function setupDisplayUsername($display_username) {
$key = sodium_crypto_aead_xchacha20poly1305_ietf_keygen();
$cyphertext = sodium_crypto_aead_xchacha20poly1305_ietf_encrypt(
htmlspecialchars($display_username),
NULL,
'',
$nonce,
$key
);

View File

@ -2,7 +2,7 @@
function output($code, $msg = '', $logs = ['']) {
http_response_code($code);
$shortCode = $code / 100 % 10;
$shortCode = intval($code / 100);
if ($shortCode === 5)
error_log('Internal error: ' . strip_tags($msg) . implode(LF, $logs));
$final_message = match ($shortCode) {

View File

@ -95,7 +95,7 @@ if (isset($_SESSION['id'])) {
output(403, 'The display username decryption key has not been sent.');
$decryption_result = htmlspecialchars(sodium_crypto_aead_xchacha20poly1305_ietf_decrypt(
$_SESSION['display-username-cyphertext'],
NULL,
'',
$_SESSION['display-username-nonce'],
base64_decode($_COOKIE['display-username-decryption-key'])
));