Skip to content

Commit 682c236

Browse files
committed
Deprecate calling ldap_exop() with more than 4 arguments
1 parent 1d41eb3 commit 682c236

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

UPGRADING

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ PHP 8.4 UPGRADE NOTES
158158
- LDAP:
159159
. Calling ldap_connect() with more than 2 arguments is deprecated. Use
160160
ldap_connect_wallet() instead.
161+
. Calling ldap_exop() with more than 4 arguments is deprecated. Use
162+
ldap_exop_sync() instead.
161163

162164
========================================
163165
5. Changed Functions

ext/ldap/ldap.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3898,6 +3898,13 @@ static void php_ldap_exop(INTERNAL_FUNCTION_PARAMETERS, bool force_sync) {
38983898
LDAPControl **lserverctrls = NULL;
38993899
int rc, msgid;
39003900

3901+
if (force_sync == false && ZEND_NUM_ARGS() > 4) {
3902+
zend_error(E_DEPRECATED, "Calling ldap_exop() with more than 4 arguments is deprecated, use ldap_exop_sync() instead");
3903+
if (UNEXPECTED(EG(exception))) {
3904+
RETURN_THROWS();
3905+
}
3906+
}
3907+
39013908
if (zend_parse_parameters(ZEND_NUM_ARGS(), "OS|S!a!zz", &link, ldap_link_ce, &reqoid, &reqdata, &serverctrls, &retdata, &retoid) != SUCCESS) {
39023909
RETURN_THROWS();
39033910
}

ext/ldap/tests/ldap_exop.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ $link = ldap_connect_and_bind($uri, $user, $passwd, $protocol_version);
6868
remove_dummy_data($link, $base);
6969
?>
7070
--EXPECTF--
71+
Deprecated: Calling ldap_exop() with more than 4 arguments is deprecated, use ldap_exop_sync() instead in %s on line %d
72+
73+
Deprecated: Calling ldap_exop() with more than 4 arguments is deprecated, use ldap_exop_sync() instead in %s on line %d
7174
bool(true)
7275
string(%d) "dn:%s"
7376
string(0) ""

0 commit comments

Comments
 (0)