Skip to content

Commit

Permalink
Added check for input parameters types in QueryExpression::equalFields.
Browse files Browse the repository at this point in the history
  • Loading branch information
skie committed Feb 12, 2016
1 parent 5ede142 commit f03f45d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Database/Expression/QueryExpression.php
Expand Up @@ -447,7 +447,13 @@ public function count()
*/
public function equalFields($left, $right)
{
return $this->eq(new IdentifierExpression($left), new IdentifierExpression($right));
$wrapIdentifier = function($field) {
if ($field instanceof ExpressionInterface) {
return $field;
}
return new IdentifierExpression($field);
};
return $this->eq($wrapIdentifier($left), $wrapIdentifier($right));
}

/**
Expand Down

0 comments on commit f03f45d

Please sign in to comment.