IcingaObjectFieldForm: fix proposed fields for...
...commands with multiple arguments in their parameters
This commit is contained in:
parent
6560864b4e
commit
d990abf0df
|
@ -54,7 +54,9 @@ class IcingaObjectFieldForm extends DirectorObjectForm
|
|||
if ($arg->argument_format === 'string') {
|
||||
$val = $arg->argument_value;
|
||||
// TODO: create var::extractMacros or so
|
||||
if (preg_match('/^\$[^\$]+\$$/', $val)) {
|
||||
|
||||
if (preg_match_all('/(\$[a-z0-9_]+\$)/', $val, $m, PREG_PATTERN_ORDER)) {
|
||||
foreach ($m[1] as $val) {
|
||||
if (array_key_exists($val, $blacklistedVars)) {
|
||||
$id = $blacklistedVars[$val];
|
||||
$suggestedFields[$id] = $existingFields[$id];
|
||||
|
@ -66,6 +68,7 @@ class IcingaObjectFieldForm extends DirectorObjectForm
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Prepare combined fields array
|
||||
$fields = array();
|
||||
|
|
Loading…
Reference in New Issue