mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
ext/ldap: Promote warning to ValueError if array is not a dict
This commit is contained in:
parent
127968b1e4
commit
d34d015078
3 changed files with 4 additions and 7 deletions
|
@ -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");
|
||||
RETVAL_FALSE;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue