[php-src] PR #17284: Fix GH-17280: ldap_search() fails when $attributes array has holes
| From: | nielsdos | Date: | Fri, 27 Dec 2024 14:54:22 +0000 |
| Subject: | [php-src] PR #17284: Fix GH-17280: ldap_search() fails when $attributes array has holes | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-30132@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/17284
Author: nielsdos
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.