From: Côme Chilliet Date: Thu, 17 Sep 2020 14:42:17 +0000 (+0200) Subject: Default bind dn and password to NULL in ldap_bind_ext X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=74b634751b8957b30ce12601884ca4a8bc9067a8;p=php Default bind dn and password to NULL in ldap_bind_ext --- diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 652a641e4f..a43edd08a7 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -1175,7 +1175,7 @@ PHP_FUNCTION(ldap_bind_ext) LDAPMessage *ldap_res; int rc; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|ssa", &link, &ldap_bind_dn, &ldap_bind_dnlen, &ldap_bind_pw, &ldap_bind_pwlen, &serverctrls) != SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!s!a", &link, &ldap_bind_dn, &ldap_bind_dnlen, &ldap_bind_pw, &ldap_bind_pwlen, &serverctrls) != SUCCESS) { RETURN_THROWS(); } diff --git a/ext/ldap/ldap.stub.php b/ext/ldap/ldap.stub.php index 8187167bec..243e57b142 100644 --- a/ext/ldap/ldap.stub.php +++ b/ext/ldap/ldap.stub.php @@ -26,7 +26,7 @@ function ldap_bind($link_identifier, string $bind_rdn = NULL, string $bind_passw * @param resource $link_identifier * @return resource|false */ -function ldap_bind_ext($link_identifier, string $bind_rdn = UNKNOWN, string $bind_password = UNKNOWN, array $servercontrols = []) {} +function ldap_bind_ext($link_identifier, string $bind_rdn = NULL, string $bind_password = NULL, array $servercontrols = []) {} #ifdef HAVE_LDAP_SASL /** @param resource $link */ diff --git a/ext/ldap/ldap_arginfo.h b/ext/ldap/ldap_arginfo.h index 9929281a7c..24cb31304b 100644 --- a/ext/ldap/ldap_arginfo.h +++ b/ext/ldap/ldap_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 53a23f4146cec03d90833de5a80a550199460207 */ + * Stub hash: 4414873610a8b2099ddad28cbadd6b8d75f66431 */ #if defined(HAVE_ORALDAP) ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_connect, 0, 0, 0) @@ -32,8 +32,8 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_bind_ext, 0, 0, 1) ZEND_ARG_INFO(0, link_identifier) - ZEND_ARG_TYPE_INFO(0, bind_rdn, IS_STRING, 0) - ZEND_ARG_TYPE_INFO(0, bind_password, IS_STRING, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, bind_rdn, IS_STRING, 0, "NULL") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, bind_password, IS_STRING, 0, "NULL") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, servercontrols, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO()