ZF2-278: Zend\Db\Predicate\Operator fails on 0 and "" (empty string)
Description
In https://github.com/zendframework/zf2/… line 80 it checks "if ($right) { .. }". $right is a value for the right side of a comparison string (in 'boo = 4', $right is (int) 4). When the comparison is 'boo = 0', $right equals to (int) 0 and the 'if' fails, not executing the setRight($right) at all (thus $right becomes the default - null). The same is true for checking if 'boo = ""' (an empty string).
$left, $operator and $leftType/$rightType might also be similarly susceptible to this in some extreme cases.
Comments
Posted by Chionsas (chionsas) on 2012-04-25T15:51:54.000+0000
I fixed this locally with https://github.com/Chionsas/zf2/… :)
Posted by Ralph Schindler (ralph) on 2012-05-11T19:58:32.000+0000
Fixed in pull request 1210 / commit a6ac879