Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUGFIX: Use numeric literal for numeric less-than filter.

  • Loading branch information...
commit fece61c90bcad215b5c6e3867ba704edbce67d3d 1 parent 0bdfc0c
@sminnee sminnee authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 search/filters/LessThanFilter.php
View
11 search/filters/LessThanFilter.php
@@ -14,11 +14,12 @@ class LessThanFilter extends SearchFilter {
*/
public function apply(DataQuery $query) {
$this->model = $query->applyRelation($this->relation);
- return $query->where(sprintf(
- "%s < '%s'",
- $this->getDbName(),
- Convert::raw2sql($this->getDbFormattedValue())
- ));
+ $value = $this->getDbFormattedValue();
+
+ if(is_numeric($value)) $filter = sprintf("%s < %s", $this->getDbName(), Convert::raw2sql($value));
+ else $filter = sprintf("%s < '%s'", $this->getDbName(), Convert::raw2sql($value));
+
+ return $query->where($filter);
}
public function isEmpty() {
Please sign in to comment.
Something went wrong with that request. Please try again.