From 6d31010feb46d45ea7c7a70b8d984a6e6f28a11f Mon Sep 17 00:00:00 2001 From: sstidl Date: Sun, 29 Dec 2024 17:50:41 +0100 Subject: [PATCH] Update docker/ui.php Co-authored-by: qodo-merge-pro-for-open-source[bot] <189517486+qodo-merge-pro-for-open-source[bot]@users.noreply.github.com> --- docker/ui.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/docker/ui.php b/docker/ui.php index 9682d90..0f68f2c 100755 --- a/docker/ui.php +++ b/docker/ui.php @@ -25,13 +25,9 @@ var SPEEDTEST_SERVERS=[]; $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; // Retrieve the host (e.g., www.example.com) - $host = $_SERVER['HTTP_HOST']; - - // Retrieve the URI (path and query string) - $uri = $_SERVER['REQUEST_URI']; - - // Combine them to get the full URL - $url = $protocol . $host . $uri; + $host = filter_var($_SERVER['HTTP_HOST'], FILTER_SANITIZE_STRING); + $uri = filter_var($_SERVER['REQUEST_URI'], FILTER_SANITIZE_URL); + $url = $protocol . htmlspecialchars($host) . htmlspecialchars($uri); array_unshift($servers, [ "name"=> "This Server",