Fix bug in UFC_Registration with 0000-00-00 00:00:00 dates
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Fri, 7 May 2010 14:13:31 +0000 (16:13 +0200)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Fri, 7 May 2010 14:13:31 +0000 (16:13 +0200)
SELECT COUNT(*) FROM accounts WHER registration_date IS NULL AND
registration_date IS NOT NULL => 16 000 rows !

Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
classes/userfilter.php

index 9362b98..0e178d9 100644 (file)
@@ -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;
     }