auth.php: disallow unencrypted logins by default

This commit is contained in:
Zankaria
2024-04-30 11:31:06 +02:00
parent 0c51d46cdf
commit da4842eb7b
5 changed files with 28 additions and 4 deletions

10
inc/functions/net.php Normal file
View File

@@ -0,0 +1,10 @@
<?php
namespace Vichan\Functions\Net;
/**
* @return bool Returns if the client-server connection is an encrypted one (HTTPS).
*/
function is_connection_secure(): bool {
return !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off';
}