From: Ferdinand Thiessen Date: Sat, 21 Oct 2023 02:00:24 +0000 (+0200) Subject: fix(user_ldap): Ensure host is a string when checking if `ldapi` X-Git-Tag: v29.0.0beta1~371^2~10 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b8fbd7721d25f9863d452db91fb3823108641dfa;p=nextcloud-server.git fix(user_ldap): Ensure host is a string when checking if `ldapi` Signed-off-by: Ferdinand Thiessen --- diff --git a/apps/user_ldap/lib/Configuration.php b/apps/user_ldap/lib/Configuration.php index 43d7b5cfbf1..b009ba3f480 100644 --- a/apps/user_ldap/lib/Configuration.php +++ b/apps/user_ldap/lib/Configuration.php @@ -607,6 +607,7 @@ class Configuration { * Returns TRUE if the ldapHost variable starts with 'ldapi://' */ public function usesLdapi(): bool { - return (substr($this->config['ldapHost'], 0, strlen('ldapi://')) === 'ldapi://'); + $host = $this->config['ldapHost']; + return is_string($host) && (substr($host, 0, strlen('ldapi://')) === 'ldapi://'); } }