From 417edec6e22ab5b63e12575101c035ea2584b04e Mon Sep 17 00:00:00 2001 From: Claudiu Cristea Date: Wed, 20 Nov 2024 09:40:19 +0200 Subject: [PATCH] Revert fda3415b (it was something different) --- ARC2.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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'];