From 4e24fd134c064f8cae54cb09d71bc5349f76fec9 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Sat, 21 Oct 2023 04:00:24 +0200 Subject: [PATCH] fix(user_ldap): Ensure host is a string when checking if `ldapi` Signed-off-by: Ferdinand Thiessen --- apps/user_ldap/lib/Configuration.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/user_ldap/lib/Configuration.php b/apps/user_ldap/lib/Configuration.php index 36258f5ad271b..aa2a125d52206 100644 --- a/apps/user_ldap/lib/Configuration.php +++ b/apps/user_ldap/lib/Configuration.php @@ -604,6 +604,7 @@ public function getAvatarAttributes(): array { * 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://'); } }