mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
db450a96e9
When using comparison with a boolean, as the filter is a string, we have to convert the data boolean to "boolean string" to avoid type-casting troubles. ## Example ```php $users = [ [ 'id' => 2, 'username' => 'johndoe', 'active' => true ], [ 'id' => 5, 'username' => 'kevin', 'active' => true ], [ 'id' => 9, 'username' => 'samantha', 'active' => false ], ]; $unactiveUsers = Hash::extract($users, '{n}[active=false]'); print_r($unactiveUsers); ``` This example returns the two unwanted active users because `"false"` is `true` but not `false` :) I think this pull request will fix this issue by converting true/false boolean to string (to match with our filter). |
||
---|---|---|
.. | ||
Cake |