Skip to content

Commit b24ee12

Browse files
committed
Fix GH-18015: Error messages for ldap_mod_replace are confusing
1 parent 3c17d3f commit b24ee12

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/ldap/ldap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2278,7 +2278,7 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper, int ext)
22782278
ldap_mods[i]->mod_bvalues[0]->bv_len = Z_STRLEN_P(value);
22792279
} else {
22802280
if (!php_ldap_is_numerically_indexed_array(Z_ARRVAL_P(value))) {
2281-
zend_argument_value_error(3, "must be an array with numeric keys");
2281+
zend_argument_value_error(3, "attribute \"%s\" must be an array with numeric keys", ZSTR_VAL(attribute));
22822282
RETVAL_FALSE;
22832283
num_berval[i] = 0;
22842284
num_attribs = i + 1;

ext/ldap/tests/ldap_add_error.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ Warning: ldap_add(): Add: Already exists in %s on line %d
104104
bool(false)
105105
string(14) "Already exists"
106106
int(68)
107-
ldap_add(): Argument #3 ($entry) must be an array with numeric keys
107+
ldap_add(): Argument #3 ($entry) attribute "objectClass" must be an array with numeric keys
108108

109109
Warning: ldap_add(): Add: Undefined attribute type in %s on line %d
110110
bool(false)

0 commit comments

Comments
 (0)