]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(user_ldap): Ensure host is a string when checking if `ldapi`
authorFerdinand Thiessen <opensource@fthiessen.de>
Sat, 21 Oct 2023 02:00:24 +0000 (04:00 +0200)
committerJoas Schilling <coding@schilljs.com>
Fri, 26 Jan 2024 13:53:32 +0000 (14:53 +0100)
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
apps/user_ldap/lib/Configuration.php

index 43d7b5cfbf1d4224d10836d6a49049d41ff1fb01..b009ba3f4809eefc741df296dfbd99b7b2231914 100644 (file)
@@ -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://');
        }
 }