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

Issue Type: Bug Created: 2012-04-25T15:30:24.000+0000 Last Updated: 2012-05-11T19:58:32.000+0000 Status: Resolved Fix version(s): Reporter: Chionsas (chionsas) Assignee: Ralph Schindler (ralph) Tags: - Zend\Db

Related issues: Attachments:


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.


Posted by Chionsas (chionsas) on 2012-04-25T15:51:54.000+0000

I fixed this locally with… :)

Posted by Ralph Schindler (ralph) on 2012-05-11T19:58:32.000+0000

Fixed in pull request 1210 / commit a6ac879

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.