Fix deprecation notices
This commit is contained in:
parent
ac6d311ada
commit
ad98060f9e
3 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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'])
|
||||
));
|
||||
|
|
Loading…
Reference in a new issue