The where() function attempts to dedupe WHERE clauses, but this could
misbehave when similar clauses are used with different data, and it's been
implicated in a symptom where CiviMail shows irrelevant attachments.
http://civicrm.stackexchange.com/a/5059/93
public function where($exprs, $args = NULL) {
$exprs = (array) $exprs;
foreach ($exprs as $expr) {
- $this->wheres[$expr] = $this->interpolate($expr, $args);
+ $evaluatedExpr = $this->interpolate($expr, $args);
+ $this->wheres[$evaluatedExpr] = $evaluatedExpr;
}
return $this;
}