Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/ldap/ldap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2235,7 +2235,7 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper, int ext)
unsigned int attribute_index = 0;
ZEND_HASH_FOREACH_STR_KEY_VAL(attributes_ht, attribute, attribute_values) {
if (attribute == NULL) {
php_error_docref(NULL, E_WARNING, "Unknown attribute in the data");
zend_argument_value_error(3, "must be an associative array of attribute => values");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The plural use is a bit strange here. I would write attribute => value or attributes => values but not mix them. WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thing is for a single attribute there might be multiple values attached to it

RETVAL_FALSE;
goto cleanup;
}
Expand Down
5 changes: 2 additions & 3 deletions ext/ldap/tests/gh16136.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,5 @@ try {
}

?>
--EXPECTF--
Warning: ldap_add(): Unknown attribute in the data in %s on line %d
bool(false)
--EXPECT--
ValueError: ldap_add(): Argument #3 ($entry) must be an associative array of attribute => values
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@ try {
?>
--EXPECTF--
ValueError: ldap_add(): Argument #3 ($entry) must not be empty

Warning: ldap_add(): Unknown attribute in the data in %s on line %d
bool(false)
ValueError: ldap_add(): Argument #3 ($entry) must be an associative array of attribute => values

Warning: ldap_add(): Add: Can't contact LDAP server in %s on line %d
bool(false)
Expand Down