Skip to content

Error messages for ldap_mod_replace are confusing #18015

Closed
@stof

Description

@stof

Description

When validating the $entry argument of ldap_mod_replace, the validation runs on each element of the array of the entry, but the error message looks like it applies on the whole entry:

[ValueError]                                                            
  ldap_modify(): Argument #3 ($entry) must be an array with numeric keys

This is quite confusing given that $entry explicitly expects an associative array. The error message should mention that this is an error related to the value of one attribute of the entry (and ideally should mention the name of the invalid attribute):

ZEND_HASH_FOREACH_STR_KEY_VAL(attributes_ht, attribute, attribute_values) {

PHP Version

PHP 8.4.4

Operating System

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions