Fix $host var handling to avoid passing null to ldap_connect

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2022-10-25 09:59:56 +02:00
parent 3dedfd34b9
commit 5242a78994
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A

View file

@ -1049,8 +1049,8 @@ class Wizard extends LDAPUtility {
private function connectAndBind(int $port, bool $tls): bool {
//connect, does not really trigger any server communication
$host = $this->configuration->ldapHost;
$hostInfo = parse_url($host);
if (!$hostInfo) {
$hostInfo = parse_url((string)$host);
if (!is_string($host) || !$hostInfo) {
throw new \Exception(self::$l->t('Invalid Host'));
}
$this->logger->debug(