* LDAP: fix not working connect under newer PHP 5.6 (maybe other versions too) with PHP Warning: invalid port number: 0

This commit is contained in:
Ralf Becker 2015-09-08 13:07:35 +00:00
parent 9ca7b66290
commit 16c5e2deec

View File

@ -188,7 +188,7 @@ class ldap
$host = parse_url($host,PHP_URL_HOST);
}
// connect to ldap server (never fails, as connection happens in bind!)
if(!$this->ds = ldap_connect($host, $port))
if(!($this->ds = !empty($port) ? ldap_connect($host, $port) : ldap_connect($host)))
{
return False;
}