From 25b0077adcd7ee9ecf488ab1c20407fa38288780 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Tue, 26 Sep 2023 11:31:53 +0300 Subject: [PATCH] fix ldap warning --- application/Espo/Core/Authentication/Ldap/Utils.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/application/Espo/Core/Authentication/Ldap/Utils.php b/application/Espo/Core/Authentication/Ldap/Utils.php index 8e4ae95e31..8144d91940 100644 --- a/application/Espo/Core/Authentication/Ldap/Utils.php +++ b/application/Espo/Core/Authentication/Ldap/Utils.php @@ -144,14 +144,17 @@ class Utils * Normalize options to LDAP client format * * @param array $options - * * @return array */ public function normalizeOptions(array $options): array { - $options['useSsl'] = (bool) ($options['useSsl'] == 'SSL'); - $options['useStartTls'] = (bool) ($options['useStartTls'] == 'TLS'); - $options['accountCanonicalForm'] = $this->accountCanonicalFormMap[$options['accountCanonicalForm']]; + $useSsl = ($options['useSsl'] ?? null) == 'SSL'; + $useStartTls = ($options['useStartTls'] ?? null) == 'TLS'; + $accountCanonicalFormKey = $options['accountCanonicalForm'] ?? 'Dn'; + + $options['useSsl'] = $useSsl; + $options['useStartTls'] = $useStartTls; + $options['accountCanonicalForm'] = $this->accountCanonicalFormMap[$accountCanonicalFormKey] ?? 1; return $options; }