Merge pull request #3714 from ignasr/fix/ldaps-port-3713

use the correct LDAPS port
This commit is contained in:
Johannes Meyer 2019-04-12 09:36:33 +02:00 committed by GitHub
commit 8fc467ca3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -1185,6 +1185,9 @@ class LdapConnection implements Selectable, Inspectable
$ldapUrls = explode(' ', $hostname);
if (count($ldapUrls) > 1) {
foreach ($ldapUrls as & $uri) {
if (preg_match('/:\d+$/', $uri) === 0) {
$uri = $uri . ':' . $this->port;
}
if (strpos($uri, '://') === false) {
$uri = 'ldaps://' . $uri;
}
@ -1192,7 +1195,7 @@ class LdapConnection implements Selectable, Inspectable
$hostname = implode(' ', $ldapUrls);
} else {
$hostname = 'ldaps://' . $hostname;
$hostname = 'ldaps://' . $hostname . ':' . $this->port;
}
}