From: Côme Chilliet Date: Thu, 17 Sep 2020 14:03:43 +0000 (+0200) Subject: Make URI parameter in ldap_connect default to NULL X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6b77252f188eaf5443d08c58df4e502c1ecb2e10;p=php Make URI parameter in ldap_connect default to NULL --- diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index a50882486a..576d97c927 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -1001,7 +1001,7 @@ PHP_FUNCTION(ldap_connect) WRONG_PARAM_COUNT; } - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|slssl", &host, &hostlen, &port, &wallet, &walletlen, &walletpasswd, &walletpasswdlen, &authmode) != SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!lssl", &host, &hostlen, &port, &wallet, &walletlen, &walletpasswd, &walletpasswdlen, &authmode) != SUCCESS) { RETURN_THROWS(); } @@ -1009,7 +1009,7 @@ PHP_FUNCTION(ldap_connect) ssl = 1; } #else - if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sl", &host, &hostlen, &port) != SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s!l", &host, &hostlen, &port) != SUCCESS) { RETURN_THROWS(); } #endif diff --git a/ext/ldap/ldap.stub.php b/ext/ldap/ldap.stub.php index 372458fe78..2c48b81246 100644 --- a/ext/ldap/ldap.stub.php +++ b/ext/ldap/ldap.stub.php @@ -4,10 +4,10 @@ #ifdef HAVE_ORALDAP /** @return resource|false */ -function ldap_connect(string $hostname = UNKNOWN, int $port = 389, string $wallet = UNKNOWN, string $wallet_passwd = UNKNOWN, int $authmode = GSLC_SSL_NO_AUTH) {} +function ldap_connect(string $uri = NULL, int $port = 389, string $wallet = UNKNOWN, string $wallet_passwd = UNKNOWN, int $authmode = GSLC_SSL_NO_AUTH) {} #else /** @return resource|false */ -function ldap_connect(string $hostname = UNKNOWN, int $port = 389) {} +function ldap_connect(string $uri = NULL, int $port = 389) {} #endif /** @param resource $link_identifier */ diff --git a/ext/ldap/ldap_arginfo.h b/ext/ldap/ldap_arginfo.h index d610408d97..4be65ae9b2 100644 --- a/ext/ldap/ldap_arginfo.h +++ b/ext/ldap/ldap_arginfo.h @@ -1,9 +1,9 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: f07138972651411473c34c5ee2d0c2de94e01ada */ + * Stub hash: 7db7fd320ca8ac2501d22f6cb473a08f47b82ad3 */ #if defined(HAVE_ORALDAP) ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_connect, 0, 0, 0) - ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, uri, IS_STRING, 0, "NULL") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, port, IS_LONG, 0, "389") ZEND_ARG_TYPE_INFO(0, wallet, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, wallet_passwd, IS_STRING, 0) @@ -13,7 +13,7 @@ ZEND_END_ARG_INFO() #if !(defined(HAVE_ORALDAP)) ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_connect, 0, 0, 0) - ZEND_ARG_TYPE_INFO(0, hostname, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, uri, IS_STRING, 0, "NULL") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, port, IS_LONG, 0, "389") ZEND_END_ARG_INFO() #endif