summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCôme Chilliet <mcmic@php.net>2020-09-17 16:40:04 +0200
committerCôme Chilliet <mcmic@php.net>2020-09-29 16:31:07 +0200
commit14385fb203e12bc4137cb7d4f1b5abe6cc5c37a0 (patch)
treef154b88080cdb5f8861b0a54226fa4ce27fcf596
parent6b77252f188eaf5443d08c58df4e502c1ecb2e10 (diff)
downloadphp-git-14385fb203e12bc4137cb7d4f1b5abe6cc5c37a0.tar.gz
Default bind dn and password to NULL in ldap_bind
-rw-r--r--ext/ldap/ldap.c2
-rw-r--r--ext/ldap/ldap.stub.php2
-rw-r--r--ext/ldap/ldap_arginfo.h6
3 files changed, 5 insertions, 5 deletions
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index 576d97c927..652a641e4f 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -1119,7 +1119,7 @@ PHP_FUNCTION(ldap_bind)
ldap_linkdata *ld;
int rc;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|ss", &link, &ldap_bind_dn, &ldap_bind_dnlen, &ldap_bind_pw, &ldap_bind_pwlen) != SUCCESS) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|s!s!", &link, &ldap_bind_dn, &ldap_bind_dnlen, &ldap_bind_pw, &ldap_bind_pwlen) != SUCCESS) {
RETURN_THROWS();
}
diff --git a/ext/ldap/ldap.stub.php b/ext/ldap/ldap.stub.php
index 2c48b81246..8187167bec 100644
--- a/ext/ldap/ldap.stub.php
+++ b/ext/ldap/ldap.stub.php
@@ -20,7 +20,7 @@ function ldap_unbind($link_identifier): bool {}
function ldap_close($link_identifier): bool {}
/** @param resource $link_identifier */
-function ldap_bind($link_identifier, string $bind_rdn = UNKNOWN, string $bind_password = UNKNOWN): bool {}
+function ldap_bind($link_identifier, string $bind_rdn = NULL, string $bind_password = NULL): bool {}
/**
* @param resource $link_identifier
diff --git a/ext/ldap/ldap_arginfo.h b/ext/ldap/ldap_arginfo.h
index 4be65ae9b2..9929281a7c 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: 7db7fd320ca8ac2501d22f6cb473a08f47b82ad3 */
+ * Stub hash: 53a23f4146cec03d90833de5a80a550199460207 */
#if defined(HAVE_ORALDAP)
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_connect, 0, 0, 0)
@@ -26,8 +26,8 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_ldap_bind, 0, 1, _IS_BOOL, 0)
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_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_ldap_bind_ext, 0, 0, 1)