From 159ddd9b565b88ee218c8294092869a52de32be4 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 11 Jan 2023 14:16:13 +0100 Subject: [PATCH] Libraries: Only attempt a partial match if the library name contains a slash fixes #4971 --- library/Icinga/Application/Libraries.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Icinga/Application/Libraries.php b/library/Icinga/Application/Libraries.php index 63662fde9e..8e4a79d4dc 100644 --- a/library/Icinga/Application/Libraries.php +++ b/library/Icinga/Application/Libraries.php @@ -80,7 +80,7 @@ public function get($name) $libraryName = $library->getName(); if ($libraryName === $name) { return $library; - } elseif (explode('/', $libraryName)[1] === $name) { + } elseif (strpos($libraryName, '/') !== false && explode('/', $libraryName)[1] === $name) { // Also return libs which only partially match $candidate = $library; }