From: Côme Bernigaud Date: Thu, 12 Nov 2015 06:04:09 +0000 (+0100) Subject: Using default port in ldap_connect when NULL is passed (this was the behavior prior... X-Git-Tag: php-5.6.17RC1~33 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=391087ed280f86f144ffa5a2b72eeeda3c271743;p=php Using default port in ldap_connect when NULL is passed (this was the behavior prior to 5.6.11) Note that passing 0 will also result in default port. --- diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index ab663b156b..da8936cd76 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -349,6 +349,9 @@ PHP_FUNCTION(ldap_connect) RETURN_FALSE; } #endif + if (!port) { + port = LDAP_PORT; + } if (LDAPG(max_links) != -1 && LDAPG(num_links) >= LDAPG(max_links)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", LDAPG(num_links));