1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.4'

* PHP-8.4:
  Fix GH-18015: Error messages for ldap_mod_replace are confusing
This commit is contained in:
Niels Dossche
2025-03-15 00:51:28 +01:00
3 changed files with 5 additions and 5 deletions

View File

@@ -2316,12 +2316,12 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper, int ext)
SEPARATE_ARRAY(attribute_values);
uint32_t num_values = zend_hash_num_elements(Z_ARRVAL_P(attribute_values));
if (num_values == 0) {
zend_argument_value_error(3, "list of attribute values must not be empty");
zend_argument_value_error(3, "attribute \"%s\" must be a non-empty list of attribute values", ZSTR_VAL(attribute));
RETVAL_FALSE;
goto cleanup;
}
if (!php_ldap_is_numerically_indexed_array(Z_ARRVAL_P(attribute_values))) {
zend_argument_value_error(3, "must be an array of attribute values with numeric keys");
zend_argument_value_error(3, "attribute \"%s\" must be an array of attribute values with numeric keys", ZSTR_VAL(attribute));
RETVAL_FALSE;
goto cleanup;
}

View File

@@ -137,7 +137,7 @@ ValueError: ldap_add(): Argument #3 ($entry) must be an associative array of att
ValueError: ldap_add(): Argument #3 ($entry) key must not be empty
ValueError: ldap_add(): Argument #3 ($entry) key must not contain any null bytes
Error: Object of class stdClass could not be converted to string
ValueError: ldap_add(): Argument #3 ($entry) list of attribute values must not be empty
ValueError: ldap_add(): Argument #3 ($entry) must be an array of attribute values with numeric keys
ValueError: ldap_add(): Argument #3 ($entry) attribute "attribute2" must be a non-empty list of attribute values
ValueError: ldap_add(): Argument #3 ($entry) attribute "attribute2" must be an array of attribute values with numeric keys
TypeError: LDAP value must be of type string|int|bool, array given
Error: Object of class stdClass could not be converted to string

View File

@@ -76,6 +76,6 @@ try {
?>
--EXPECT--
Error: Object of class stdClass could not be converted to string
ValueError: ldap_add(): Argument #3 ($entry) list of attribute values must not be empty
ValueError: ldap_add(): Argument #3 ($entry) attribute "attribute2" must be a non-empty list of attribute values
TypeError: LDAP value must be of type string|int|bool, array given
TypeError: LDAP value must be of type string|int|bool, stdClass given