Merge pull request #8417 from hregis/7.0_bug3

Fix: replace ldaps:// by ssl://
This commit is contained in:
Laurent Destailleur 2018-03-19 12:38:14 +01:00 committed by GitHub
commit 13801a0d93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -738,6 +738,10 @@ class Ldap
*/
function serverPing($host, $port=389, $timeout=1)
{
// Replace ldaps:// by ssl://
if (preg_match('/^ldaps:\/\/([^\/]+)\/?$/',$host, $regs)) {
$host = 'ssl://'.$regs[1];
}
$op = @fsockopen($host, $port, $errno, $errstr, $timeout);
if (!$op) return false; //DC is N/A
else {