ZF2-278: Zend\Db\Predicate\Operator fails on 0 and "" (empty string)


In… 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.


I fixed this locally with… :)

Fixed in pull request 1210 / commit a6ac879