diff --git a/ARC2.php b/ARC2.php index 14269be..0688d01 100644 --- a/ARC2.php +++ b/ARC2.php @@ -46,8 +46,7 @@ public static function getIncPath($f = '') public static function getScriptURI() { if (isset($_SERVER) && (isset($_SERVER['SERVER_NAME']) || isset($_SERVER['HTTP_HOST']))) { - $server_proto = strtolower($_SERVER['SERVER_PROTOCOL'] ?? 'http'); - $proto = preg_replace('/^([a-z]+)\/.*$/', '\\1', $server_proto); + $proto = preg_replace('/^([a-z]+)\/.*$/', '\\1', strtolower($_SERVER['SERVER_PROTOCOL'] ?? 'http')); $port = $_SERVER['SERVER_PORT']; $server = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']; $script = $_SERVER['SCRIPT_NAME']; @@ -68,8 +67,7 @@ public static function getScriptURI() public static function getRequestURI() { if (isset($_SERVER) && isset($_SERVER['REQUEST_URI'])) { - $server_proto = strtolower($_SERVER['SERVER_PROTOCOL'] ?? 'http'); - return preg_replace('/^([a-z]+)\/.*$/', '\\1', $server_proto). + return preg_replace('/^([a-z]+)\/.*$/', '\\1', strtolower($_SERVER['SERVER_PROTOCOL'] ?? 'http')). '://'.(isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']). (80 != $_SERVER['SERVER_PORT'] ? ':'.$_SERVER['SERVER_PORT'] : ''). $_SERVER['REQUEST_URI'];