mirror of
https://github.com/php/php-src.git
synced 2025-08-19 17:04:47 +02:00
Merge branch 'php-7.0'
* php-7.0: Revert "Added back support for undocummented host:port syntax" Revert "Using default port in ldap_connect when NULL is passed (this was the behavior prior to 5.6.11)"
This commit is contained in:
commit
56b584491b
2 changed files with 1 additions and 14 deletions
|
@ -345,9 +345,6 @@ PHP_FUNCTION(ldap_connect)
|
||||||
RETURN_FALSE;
|
RETURN_FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (!port) {
|
|
||||||
port = LDAP_PORT;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (LDAPG(max_links) != -1 && LDAPG(num_links) >= LDAPG(max_links)) {
|
if (LDAPG(max_links) != -1 && LDAPG(num_links) >= LDAPG(max_links)) {
|
||||||
php_error_docref(NULL, E_WARNING, "Too many open links (%pd)", LDAPG(num_links));
|
php_error_docref(NULL, E_WARNING, "Too many open links (%pd)", LDAPG(num_links));
|
||||||
|
@ -368,13 +365,8 @@ PHP_FUNCTION(ldap_connect)
|
||||||
}
|
}
|
||||||
|
|
||||||
url = emalloc(urllen);
|
url = emalloc(urllen);
|
||||||
if (host && (strchr(host, ':') != NULL)) {
|
|
||||||
/* Legacy support for host:port */
|
|
||||||
snprintf( url, urllen, "ldap://%s", host );
|
|
||||||
} else {
|
|
||||||
snprintf( url, urllen, "ldap://%s:%ld", host ? host : "", port );
|
snprintf( url, urllen, "ldap://%s:%ld", host ? host : "", port );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef LDAP_API_FEATURE_X_OPENLDAP
|
#ifdef LDAP_API_FEATURE_X_OPENLDAP
|
||||||
/* ldap_init() is deprecated, use ldap_initialize() instead.
|
/* ldap_init() is deprecated, use ldap_initialize() instead.
|
||||||
|
|
|
@ -28,10 +28,6 @@ var_dump($link);
|
||||||
// bad hostname (connect should work, not bind)
|
// bad hostname (connect should work, not bind)
|
||||||
$link = ldap_connect("nonexistent" . $host);
|
$link = ldap_connect("nonexistent" . $host);
|
||||||
var_dump($link);
|
var_dump($link);
|
||||||
|
|
||||||
// Legacy host:port syntax
|
|
||||||
$link = ldap_connect("$host:$port");
|
|
||||||
var_dump($link);
|
|
||||||
?>
|
?>
|
||||||
===DONE===
|
===DONE===
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
|
@ -40,5 +36,4 @@ resource(%d) of type (ldap link)
|
||||||
resource(%d) of type (ldap link)
|
resource(%d) of type (ldap link)
|
||||||
resource(%d) of type (ldap link)
|
resource(%d) of type (ldap link)
|
||||||
resource(%d) of type (ldap link)
|
resource(%d) of type (ldap link)
|
||||||
resource(%d) of type (ldap link)
|
|
||||||
===DONE===
|
===DONE===
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue