From 098bcfb98f63c7cc00f89af73d4c11df2e80a55b Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 13 Jan 2020 13:46:32 +0100 Subject: [PATCH 1/2] LdapConnection: Ignore unknown vendor upon inspection --- library/Icinga/Protocol/Ldap/LdapConnection.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Protocol/Ldap/LdapConnection.php b/library/Icinga/Protocol/Ldap/LdapConnection.php index fa4c4010a..a898db2d2 100644 --- a/library/Icinga/Protocol/Ldap/LdapConnection.php +++ b/library/Icinga/Protocol/Ldap/LdapConnection.php @@ -1533,7 +1533,10 @@ class LdapConnection implements Selectable, Inspectable try { $cap = LdapCapabilities::discoverCapabilities($this); $discovery = new Inspection('Discovery Results'); - $discovery->write($cap->getVendor()); + $vendor = $cap->getVendor(); + if (isset($vendor)) { + $discovery->write($vendor); + } $version = $cap->getVersion(); if (isset($version)) { $discovery->write($version); From 425699d7b0757f8dd702731f44249dbdb166ef4d Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 13 Jan 2020 13:47:37 +0100 Subject: [PATCH 2/2] forms/Config: Don't call `array_map` without an array --- application/forms/Config/ResourceConfigForm.php | 2 +- application/forms/Config/UserBackendConfigForm.php | 2 +- application/forms/Config/UserGroup/UserGroupBackendForm.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/forms/Config/ResourceConfigForm.php b/application/forms/Config/ResourceConfigForm.php index dc3565ed5..fe12aca6e 100644 --- a/application/forms/Config/ResourceConfigForm.php +++ b/application/forms/Config/ResourceConfigForm.php @@ -321,7 +321,7 @@ class ResourceConfigForm extends ConfigForm $inspection = static::inspectResource($this); if ($inspection !== null) { $join = function ($e) use (&$join) { - return is_string($e) ? $e : join("\n", array_map($join, $e)); + return is_array($e) ? join("\n", array_map($join, $e)) : $e; }; $this->addElement( 'note', diff --git a/application/forms/Config/UserBackendConfigForm.php b/application/forms/Config/UserBackendConfigForm.php index 16ce4bdf9..8124e9d48 100644 --- a/application/forms/Config/UserBackendConfigForm.php +++ b/application/forms/Config/UserBackendConfigForm.php @@ -398,7 +398,7 @@ class UserBackendConfigForm extends ConfigForm $inspection = static::inspectUserBackend($this); if ($inspection !== null) { $join = function ($e) use (&$join) { - return is_string($e) ? $e : join("\n", array_map($join, $e)); + return is_array($e) ? join("\n", array_map($join, $e)) : $e; }; $this->addElement( 'note', diff --git a/application/forms/Config/UserGroup/UserGroupBackendForm.php b/application/forms/Config/UserGroup/UserGroupBackendForm.php index 68e5ec6b2..bfc1ef575 100644 --- a/application/forms/Config/UserGroup/UserGroupBackendForm.php +++ b/application/forms/Config/UserGroup/UserGroupBackendForm.php @@ -230,7 +230,7 @@ class UserGroupBackendForm extends ConfigForm $inspection = static::inspectUserBackend($this); if ($inspection !== null) { $join = function ($e) use (&$join) { - return is_string($e) ? $e : join("\n", array_map($join, $e)); + return is_array($e) ? join("\n", array_map($join, $e)) : $e; }; $this->addElement( 'note',