From 34ff12f64faa4cb167f67434aa63b7e72e9b20b0 Mon Sep 17 00:00:00 2001 From: simonmicro Date: Tue, 23 May 2023 22:57:01 +0200 Subject: [PATCH] Added PHP version check --- www/index.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/www/index.php b/www/index.php index c0cdb5c..d3ca129 100644 --- a/www/index.php +++ b/www/index.php @@ -15,7 +15,10 @@ $clientVersion = isset($body->version) ? $body->version : null; // Fake API $result = null; -if(isset($_GET['path'])) { +if (version_compare(PHP_VERSION, '8.0.0', '<')) { + $result = array('error_msg' => 'This API only supports PHP 8 or higher.'); + $code = 500; +} else if(isset($_GET['path'])) { $path = trim($_GET['path'], ' /'); $pathParts = explode('/', $_GET['path']); if(count($pathParts) > 0 && $pathParts[0] == 'healthz') {