From 8064f9e98c3c2ca579a86362aac63db96c3f9984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Anne?= Date: Wed, 15 Jan 2025 17:38:57 +0100 Subject: [PATCH] Fix CAS server status check fixes #18346 --- src/System/Status/StatusChecker.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/System/Status/StatusChecker.php b/src/System/Status/StatusChecker.php index 34d9ec13d79..533ffb864b9 100644 --- a/src/System/Status/StatusChecker.php +++ b/src/System/Status/StatusChecker.php @@ -389,11 +389,14 @@ public static function getCASStatus($public_only = true): array if ($status === null) { $status['status'] = self::STATUS_NO_DATA; if (!empty($CFG_GLPI['cas_host'])) { - $url = $CFG_GLPI['cas_host']; + // Rebuild CAS URL + // see `CAS_Client::_getServerBaseURL()` + $url = 'https://' . $CFG_GLPI['cas_host']; if (!empty($CFG_GLPI['cas_port'])) { $url .= ':' . (int)$CFG_GLPI['cas_port']; } $url .= '/' . $CFG_GLPI['cas_uri']; + if (Toolbox::isUrlSafe($url)) { $data = Toolbox::getURLContent($url); if (!empty($data)) {