phalcon/cphalcon

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

Closed this issue · 1 comments

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)

Resolved in #16584

Thank you @aa65535