Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

$left and $right should be compared to null while validating, because…

… if you try to create a sentence like : where field = 0, $right will be equal to 0 which will make line 80 evaluate to false, never calling $this->setRight($right)
  • Loading branch information...
commit 164ccc3313577e736976b9aa6ef0f9b6f430f65a 1 parent 2cef17e
@rsandrea authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 library/Zend/Db/Sql/Predicate/Operator.php
View
4 library/Zend/Db/Sql/Predicate/Operator.php
@@ -71,13 +71,13 @@ class Operator implements PredicateInterface
*/
public function __construct($left = null, $operator = self::OPERATOR_EQUAL_TO, $right = null, $leftType = self::TYPE_IDENTIFIER, $rightType = self::TYPE_VALUE)
{
- if ($left) {
+ if (null !== $left) {
$this->setLeft($left);
}
if ($operator) {
$this->setOperator($operator);
}
- if ($right) {
+ if (null !== $right) {
$this->setRight($right);
}
if ($leftType) {
Please sign in to comment.
Something went wrong with that request. Please try again.