phalcon / cphalcon

High performance, full-stack PHP framework delivered as a C extension.
https://phalcon.io
BSD 3-Clause "New" or "Revised" License
10.79k stars 1.96k forks source link

[BUG]: Phalcon\Filter\Sanitize\BoolVal is not working as expected. #16582

Closed aa65535 closed 6 months ago

aa65535 commented 6 months ago

Questions? Forum: https://phalcon.io/forum or Discord: https://phalcon.io/discord

Describe the bug Because in_array does not use strict comparison by default, which leads to BoolVal not working as expected.

To Reproduce

Provide output if related. Provide coredump if any. Use https://docs.phalcon.io/latest/generating-backtrace as reference.

Steps to reproduce the behavior:

https://github.com/phalcon/cphalcon/blob/master/phalcon/Filter/Sanitize/BoolVal.zep#L29-L38

$check = $this->filter->sanitize(0, 'bool');
var_dump($check);

output

bool(true)
niden commented 6 months ago

Resolved in https://github.com/phalcon/cphalcon/pull/16584

Thank you @aa65535