ProcessCheckResultCommandForm: Use substr instead of pregmatch
refs #9672
This commit is contained in:
parent
18f382e85e
commit
b5ae4599fd
|
@ -124,7 +124,7 @@ class ProcessCheckResultCommandForm extends ObjectsCommandForm
|
||||||
ProcessCheckResultCommand::HOST_DOWN => $this->translate('DOWN', 'icinga.state')
|
ProcessCheckResultCommand::HOST_DOWN => $this->translate('DOWN', 'icinga.state')
|
||||||
);
|
);
|
||||||
|
|
||||||
if (! preg_match('~^v2\.\d+\.\d+.*$~', $this->getBackend()->getProgramVersion())) {
|
if (substr($this->getBackend()->getProgramVersion(), 0, 2) !== 'v2') {
|
||||||
$options[ProcessCheckResultCommand::HOST_UNREACHABLE] = $this->translate('UNREACHABLE', 'icinga.state');
|
$options[ProcessCheckResultCommand::HOST_UNREACHABLE] = $this->translate('UNREACHABLE', 'icinga.state');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue