From: Raphaël Barrois Date: Fri, 7 May 2010 14:13:31 +0000 (+0200) Subject: Fix bug in UFC_Registration with 0000-00-00 00:00:00 dates X-Git-Tag: xorg/1.0.0~262 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=c9c74e4f21efaed0aed017e2b21b25bfde9d98b4;p=platal.git Fix bug in UFC_Registration with 0000-00-00 00:00:00 dates SELECT COUNT(*) FROM accounts WHER registration_date IS NULL AND registration_date IS NOT NULL => 16 000 rows ! Signed-off-by: Raphaël Barrois --- diff --git a/classes/userfilter.php b/classes/userfilter.php index 9362b98..0e178d9 100644 --- a/classes/userfilter.php +++ b/classes/userfilter.php @@ -459,7 +459,7 @@ class UFC_Registered implements UserFilterCondition $date = 'a.uid IS NOT NULL AND a.state != \'pending\''; } if (!is_null($this->comparison)) { - $date .= ' AND a.registration_date ' . $this->comparison . ' ' . XDB::format('{?}', $this->date->format('Y-m-d')); + $date .= ' AND a.registration_date != \'0000-00-00 00:00:00\' AND a.registration_date ' . $this->comparison . ' ' . XDB::format('{?}', $this->date->format('Y-m-d')); } return $date; }