mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +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;
|
unsigned int attribute_index = 0;
|
||||||
ZEND_HASH_FOREACH_STR_KEY_VAL(attributes_ht, attribute, attribute_values) {
|
ZEND_HASH_FOREACH_STR_KEY_VAL(attributes_ht, attribute, attribute_values) {
|
||||||
if (attribute == NULL) {
|
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;
|
RETVAL_FALSE;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,5 @@ try {
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECT--
|
||||||
Warning: ldap_add(): Unknown attribute in the data in %s on line %d
|
ValueError: ldap_add(): Argument #3 ($entry) must be an associative array of attribute => values
|
||||||
bool(false)
|
|
||||||
|
|
|
@ -133,9 +133,7 @@ try {
|
||||||
?>
|
?>
|
||||||
--EXPECTF--
|
--EXPECTF--
|
||||||
ValueError: ldap_add(): Argument #3 ($entry) must not be empty
|
ValueError: ldap_add(): Argument #3 ($entry) must not be empty
|
||||||
|
ValueError: ldap_add(): Argument #3 ($entry) must be an associative array of attribute => values
|
||||||
Warning: ldap_add(): Unknown attribute in the data in %s on line %d
|
|
||||||
bool(false)
|
|
||||||
|
|
||||||
Warning: ldap_add(): Add: Can't contact LDAP server in %s on line %d
|
Warning: ldap_add(): Add: Can't contact LDAP server in %s on line %d
|
||||||
bool(false)
|
bool(false)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue