some fixes

This commit is contained in:
2021-04-07 00:03:14 +02:00
parent 43f4407269
commit af27b7c302
4 changed files with 176 additions and 50 deletions

View File

@@ -14,7 +14,11 @@ spl_autoload_register(function($class) {
function getProtocol(): string {
return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https" : "http";
$isSecure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ||
(!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') ||
(!empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on');
return $isSecure ? 'https' : 'http';
}
function generateRandomString($length): string {