]> granicus.if.org Git - php/commitdiff
Using default port in ldap_connect when NULL is passed (this was the behavior prior...
authorCôme Bernigaud <mcmic@php.net>
Thu, 12 Nov 2015 06:04:09 +0000 (07:04 +0100)
committerCôme Bernigaud <mcmic@php.net>
Thu, 12 Nov 2015 06:06:05 +0000 (07:06 +0100)
Note that passing 0 will also result in default port.

ext/ldap/ldap.c

index ab663b156be320c3bba8a7267187105adc47361a..da8936cd763cc891b77134e6ae97d771e7c42e55 100644 (file)
@@ -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));