diff --git a/lib/dao/dao.class.php b/lib/dao/dao.class.php index 9513573836..20e42cacac 100755 --- a/lib/dao/dao.class.php +++ b/lib/dao/dao.class.php @@ -1428,6 +1428,8 @@ class sql public function between($min, $max) { if($this->inCondition and !$this->conditionIsTrue) return $this; + $min = $this->quote($min); + $max = $this->quote($max); $this->sql .= " BETWEEN $min AND $max "; return $this; } diff --git a/module/task/model.php b/module/task/model.php index 7cb19433dd..a714c7caf0 100644 --- a/module/task/model.php +++ b/module/task/model.php @@ -306,7 +306,7 @@ class taskModel extends model ->andWhere('t1.deleted')->eq(0) ->beginIF($type == 'needconfirm')->andWhere('t2.version > t1.storyVersion')->andWhere("t2.status = 'active'")->fi() ->beginIF($type == 'assignedtome')->andWhere('t1.assignedTo')->eq($this->app->user->account)->fi() - ->beginIF($type == 'delayed')->andWhere('deadline')->lt(helper::now())->fi() + ->beginIF($type == 'delayed')->andWhere('deadline')->between('1970-1-1', helper::now())->fi() ->beginIF(strpos('all|needconfirm|assignedtome|delayed', $type) === false)->andWhere('t1.status')->in($type)->fi() ->orderBy($orderBy) ->page($pager)