From b24ee12d13298f6b19b71fdb74030c48f0f78860 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Thu, 13 Mar 2025 22:00:43 +0100 Subject: [PATCH] Fix GH-18015: Error messages for ldap_mod_replace are confusing --- ext/ldap/ldap.c | 2 +- ext/ldap/tests/ldap_add_error.phpt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 67b01c0ec4472..20245ed56961b 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -2278,7 +2278,7 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper, int ext) ldap_mods[i]->mod_bvalues[0]->bv_len = Z_STRLEN_P(value); } else { if (!php_ldap_is_numerically_indexed_array(Z_ARRVAL_P(value))) { - zend_argument_value_error(3, "must be an array with numeric keys"); + zend_argument_value_error(3, "attribute \"%s\" must be an array with numeric keys", ZSTR_VAL(attribute)); RETVAL_FALSE; num_berval[i] = 0; num_attribs = i + 1; diff --git a/ext/ldap/tests/ldap_add_error.phpt b/ext/ldap/tests/ldap_add_error.phpt index 5036b3091e835..209a7fb165dc5 100644 --- a/ext/ldap/tests/ldap_add_error.phpt +++ b/ext/ldap/tests/ldap_add_error.phpt @@ -104,7 +104,7 @@ Warning: ldap_add(): Add: Already exists in %s on line %d bool(false) string(14) "Already exists" int(68) -ldap_add(): Argument #3 ($entry) must be an array with numeric keys +ldap_add(): Argument #3 ($entry) attribute "objectClass" must be an array with numeric keys Warning: ldap_add(): Add: Undefined attribute type in %s on line %d bool(false)