From 9cb938720609b91f6158fdb1e185035e2a8ce72c Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Thu, 14 Oct 2021 10:11:27 +0200 Subject: [PATCH] Allow Or modules without version also --- library/Icinga/Application/Modules/Module.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Application/Modules/Module.php b/library/Icinga/Application/Modules/Module.php index 12a8e3f67..7519cf0ca 100644 --- a/library/Icinga/Application/Modules/Module.php +++ b/library/Icinga/Application/Modules/Module.php @@ -1003,11 +1003,13 @@ class Module $parts = preg_split('/,\s+/', $val); foreach ($parts as $i => $part) { - if (strpos($part, '|') !== false) { + if (strpos($part, ' | ') !== false) { $orParts = array_map('trim', explode('|', $part)); foreach ($orParts as $orPart) { if (preg_match('/^([\w\-\/]+)\s+\((.+)\)$/', $orPart, $m)) { $metadata->{$key}['|' . $i][$m[1]] = $m[2]; + } elseif (preg_match('/^([\w\-\/]+)$/', $orPart, $m)) { + $metadata->{$key}['|' . $i][$m[1]] = null; } } } elseif (preg_match('/^([\w\-\/]+)\s+\((.+)\)$/', $part, $m)) {