Commit graph

7 commits

Author SHA1 Message Date
Niels Dossche
f90323c8d4
Fix GH-17280: ldap_search() fails when $attributes array has holes (#17284)
We relax the constraint that the array must be a list. What really
matters is that it only has numeric keys. As shown in the example code,
it's really easy to accidentally create a non-list array, so it makes
sense to relax the constraint.
There are 3 cases left where the array is checked to be a list,
in php_ldap_do_search, but I believe this makes sense to keep because
the indices of those arrays have a meaning because they should match
between different arrays. In that case it will prevent programmer
errors.
2024-12-27 17:58:50 +01:00
Gina Peter Banyard
332e9a47ae
ext/ldap: Use "p" ZPP specifier for all strings that must be null terminated (#16091) 2024-09-28 00:15:34 +01:00
Gina Peter Banyard
21955a9a8d ext/ldap: Refactor looping of modifications array 2024-09-27 19:38:14 +01:00
Gina Peter Banyard
cf043af8fc ext/ldap: Refactor verification of modification entry 2024-09-27 19:38:14 +01:00
Gina Peter Banyard
0a39b48acc ext/ldap: Use zend_array_is_list() API to check "values" array 2024-09-27 19:38:14 +01:00
Gina Peter Banyard
6f50850e76 ext/ldap: Use zend_*_has_nul_byte() APIs
And also make them throw ValueErrors instead of TypeErrors
2024-09-27 19:38:14 +01:00
Gina Peter Banyard
25b631d72b ext/ldap: Add test cases for (Value|Type)Errors in ldap_modify_batch() 2024-09-27 19:38:14 +01:00