Restore getUserMemberStatus function to original implementation and fix database queries
This commit is contained in:
15
env.php
15
env.php
@@ -4,6 +4,21 @@ require_once __DIR__ . '/vendor/autoload.php';
|
||||
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
|
||||
$dotenv->load();
|
||||
|
||||
// Normalize HTTPS detection behind proxies and based on HOST env
|
||||
// If behind a reverse proxy, X-Forwarded-Proto may indicate HTTPS
|
||||
$forwardedProto = isset($_SERVER['HTTP_X_FORWARDED_PROTO']) ? strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) : null;
|
||||
$hostEnv = $_ENV['HOST'] ?? null;
|
||||
|
||||
// If HOST env is set and starts with https, treat as secure
|
||||
if (is_string($hostEnv) && stripos($hostEnv, 'https://') === 0) {
|
||||
$_SERVER['HTTPS'] = 'on';
|
||||
}
|
||||
|
||||
// If proxy indicates https, treat connection as secure
|
||||
if ($forwardedProto === 'https') {
|
||||
$_SERVER['HTTPS'] = 'on';
|
||||
}
|
||||
|
||||
// PSR-4 Autoloader for Services and Controllers
|
||||
spl_autoload_register(function ($class) {
|
||||
// Remove leading namespace separator
|
||||
|
||||
Reference in New Issue
Block a user