Ver código fonte

Fix deprecation notices

Miraty 2 anos atrás
pai
commit
ad98060f9e
3 arquivos alterados com 3 adições e 3 exclusões
  1. 1 1
      fn/auth.php
  2. 1 1
      fn/common.php
  3. 1 1
      router.php

+ 1 - 1
fn/auth.php

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

+ 1 - 1
fn/common.php

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

+ 1 - 1
router.php

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