Skip to content

Commit 0d915c5

Browse files
committed
fix need to apply to LDAP_MOD_ADD only
1 parent 6499b56 commit 0d915c5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/ldap/ldap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2339,13 +2339,13 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper, bool ext)
23392339
SEPARATE_ARRAY(attribute_values);
23402340
uint32_t num_values = zend_hash_num_elements(Z_ARRVAL_P(attribute_values));
23412341
if (num_values == 0) {
2342-
if (UNEXPECTED(is_full_add)) {
2342+
if (UNEXPECTED(oper == LDAP_MOD_ADD)) {
23432343
zend_argument_value_error(3, "attribute \"%s\" must be a non-empty list of attribute values", ZSTR_VAL(attribute));
23442344
RETVAL_FALSE;
23452345
goto cleanup;
23462346
}
2347-
/* When we modify, we means we delete the attribute */
2348-
attribute_index ++;
2347+
/* When we modify, we mean we delete the attribute */
2348+
attribute_index++;
23492349
continue;
23502350
}
23512351
if (!php_ldap_is_numerically_indexed_array(Z_ARRVAL_P(attribute_values))) {

0 commit comments

Comments
 (0)