mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-05-28 04:34:08 -04:00
Avoid passing non-string args to ctype_*() functions
This commit is contained in:
parent
f96abb4627
commit
0c3cf6b7bd
1 changed files with 7 additions and 3 deletions
|
|
@ -54,10 +54,13 @@ class SimulationForm extends QuickForm
|
|||
'class' => 'autosubmit',
|
||||
'value' => $this->simulatedNode ? $node->getState() : null,
|
||||
));
|
||||
if (in_array($this->getSentValue('state'), array('0', '99'))) {
|
||||
|
||||
$sentState = $this->getSentValue('state');
|
||||
if (in_array($sentState, array('0', '99'))) {
|
||||
return;
|
||||
}
|
||||
if ($hasSimulation || ctype_digit($this->getSentValue('state'))) {
|
||||
|
||||
if ($hasSimulation || ($sentState !== null && ctype_digit($sentState))) {
|
||||
$this->addElement('checkbox', 'acknowledged', array(
|
||||
'label' => $this->translate('Acknowledged'),
|
||||
'value' => $node->isAcknowledged(),
|
||||
|
|
@ -98,8 +101,9 @@ class SimulationForm extends QuickForm
|
|||
public function onSuccess()
|
||||
{
|
||||
$nodeName = $this->node->getName();
|
||||
$state = $this->getValue('state');
|
||||
|
||||
if (ctype_digit($this->getValue('state'))) {
|
||||
if ($state !== null && ctype_digit($state)) {
|
||||
$this->notifySuccess($this->translate('Simulation has been set'));
|
||||
$this->simulation->set($nodeName, (object) array(
|
||||
'state' => $this->getValue('state'),
|
||||
|
|
|
|||
Loading…
Reference in a new issue