* 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:08:00 +00:00
parent 223135c7fb
commit ff2d675d36

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;
}