From be70cb23ae08f34f1c97cbee6be0c9aef140e672 Mon Sep 17 00:00:00 2001 From: Amir Moradi <1281163+amirhmoradi@users.noreply.github.com> Date: Sun, 23 Jul 2023 21:50:37 +0200 Subject: [PATCH] Fix path processing in index.php --- www/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/index.php b/www/index.php index c0302a5..595cfae 100644 --- a/www/index.php +++ b/www/index.php @@ -26,10 +26,10 @@ if (version_compare(PHP_VERSION, '8.0.0', '<')) { $code = 500; } else if(isset($_GET['path'])) { $path = trim($_GET['path'], ' /'); - $pathParts = explode('/', $_GET['path']); + $pathParts = explode('/', $path); if(count($pathParts) > 0 && $pathParts[0] == 'healthz') { $result = 'OK'; - } else if(count($pathParts) > 1 && $pathParts[0] == 'notification') { + } else if(count($pathParts) > 0 && $pathParts[0] == 'notification') { // Any notification/[version] will be answered here $msg = 'Fake API endpoint for v' . $minVersionName . ' active and reachable (contacted at ' . date('r') . ').'; if(intval($pathParts[1]) < $minVersionNumber) {