mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-25 18:59:04 +02:00
Allow Or modules without version also
This commit is contained in:
parent
b1c48a9069
commit
9cb9387206
@ -1003,11 +1003,13 @@ class Module
|
|||||||
|
|
||||||
$parts = preg_split('/,\s+/', $val);
|
$parts = preg_split('/,\s+/', $val);
|
||||||
foreach ($parts as $i => $part) {
|
foreach ($parts as $i => $part) {
|
||||||
if (strpos($part, '|') !== false) {
|
if (strpos($part, ' | ') !== false) {
|
||||||
$orParts = array_map('trim', explode('|', $part));
|
$orParts = array_map('trim', explode('|', $part));
|
||||||
foreach ($orParts as $orPart) {
|
foreach ($orParts as $orPart) {
|
||||||
if (preg_match('/^([\w\-\/]+)\s+\((.+)\)$/', $orPart, $m)) {
|
if (preg_match('/^([\w\-\/]+)\s+\((.+)\)$/', $orPart, $m)) {
|
||||||
$metadata->{$key}['|' . $i][$m[1]] = $m[2];
|
$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)) {
|
} elseif (preg_match('/^([\w\-\/]+)\s+\((.+)\)$/', $part, $m)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user