fix some SERVER_NAME references

This commit is contained in:
IsaiDiaz
2025-07-03 09:56:35 -04:00
parent f58158cb46
commit b1bea76b52
2 changed files with 6 additions and 5 deletions

View File

@@ -1630,10 +1630,11 @@ class System
public static function getServerHostname()
{
$host = "";
if (!empty($_SERVER['SERVER_NAME'])) {
$host = $_SERVER['SERVER_NAME'];
} else if (defined('SERVER_NAME')) {
if (defined('SERVER_NAME')) {
$host = SERVER_NAME;
} else {
$hostParts = explode(':', $_SERVER['HTTP_HOST'] ?? '');
$host = isset($hostParts[0]) ? $hostParts[0] : $_SERVER['SERVER_NAME'];
}
return $host;
}