diff --git a/lib/Net/LDAP3.php b/lib/Net/LDAP3.php --- a/lib/Net/LDAP3.php +++ b/lib/Net/LDAP3.php @@ -635,7 +635,7 @@ ldap_set_option($lc, LDAP_OPT_REFERRALS, (bool) $referrals); } - $this->_current_host = $host; + $this->_current_host = $host . (strpos($host, ':') ? '' : ":$port"); $this->conn = $lc; break; @@ -789,9 +789,7 @@ $moz_ldapsearch, '-x', '-h', - preg_replace('|^[a-z]+://|i', '', $this->_current_host), - '-p', - $this->config_get('port', 389), + $this->_current_host, '-b', escapeshellarg($entry_dn), '-s',