IcingaHost, IcingaServiceForm: fix parse error...
...on PHP < 5.5
This commit is contained in:
parent
6cc1a90b0a
commit
8dd7fcd13b
|
@ -279,19 +279,19 @@ class IcingaServiceForm extends DirectorObjectForm
|
|||
protected function succeedForOverrides()
|
||||
{
|
||||
|
||||
$vars = (object) array();
|
||||
$vars = array();
|
||||
foreach ($this->object->vars() as $key => $var) {
|
||||
$vars->$key = $var->getValue();
|
||||
$vars[$key] = $var->getValue();
|
||||
}
|
||||
|
||||
$host = $this->host;
|
||||
$serviceName = $this->object->object_name;
|
||||
|
||||
$this->host->overrideServiceVars($serviceName, $vars);
|
||||
$this->host->overrideServiceVars($serviceName, (object) $vars);
|
||||
|
||||
if ($host->hasBeenModified()) {
|
||||
$msg = sprintf(
|
||||
empty((array) $vars)
|
||||
empty($vars)
|
||||
? $this->translate('All overrides have been removed from "%s"')
|
||||
: $this->translate('The given properties have been stored for "%s"'),
|
||||
$this->translate($host->object_name)
|
||||
|
|
|
@ -239,7 +239,9 @@ class IcingaHost extends IcingaObject
|
|||
|
||||
public function overrideServiceVars($service, $vars)
|
||||
{
|
||||
if (empty((array) $vars)) {
|
||||
// For PHP < 5.5.0:
|
||||
$array = (array) $vars;
|
||||
if (empty($array)) {
|
||||
return $this->unsetOverriddenServiceVars($service);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue