mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
ext/ldap: Check that array key is not empty
This commit is contained in:
parent
72ee812e2a
commit
0733e90c7f
2 changed files with 6 additions and 3 deletions
|
@ -2239,6 +2239,11 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper, int ext)
|
||||||
RETVAL_FALSE;
|
RETVAL_FALSE;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
if (ZSTR_LEN(attribute) == 0) {
|
||||||
|
zend_argument_value_error(3, "key must not be empty");
|
||||||
|
RETVAL_FALSE;
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
if (zend_str_has_nul_byte(attribute)) {
|
if (zend_str_has_nul_byte(attribute)) {
|
||||||
zend_argument_value_error(3, "key must not contain any null bytes");
|
zend_argument_value_error(3, "key must not contain any null bytes");
|
||||||
RETVAL_FALSE;
|
RETVAL_FALSE;
|
||||||
|
|
|
@ -134,9 +134,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
|
ValueError: ldap_add(): Argument #3 ($entry) must be an associative array of attribute => values
|
||||||
|
ValueError: ldap_add(): Argument #3 ($entry) key must not be empty
|
||||||
Warning: ldap_add(): Add: Can't contact LDAP server in %s on line %d
|
|
||||||
bool(false)
|
|
||||||
ValueError: ldap_add(): Argument #3 ($entry) key must not contain any null bytes
|
ValueError: ldap_add(): Argument #3 ($entry) key must not contain any null bytes
|
||||||
Error: Object of class stdClass could not be converted to string
|
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) list of attribute values must not be empty
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue