fix advanced search
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Thu, 9 Dec 2004 18:57:12 +0000 (18:57 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:26:32 +0000 (23:26 +0200)
git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-63

include/search.classes.inc.php

index 2208eed..d996d27 100644 (file)
@@ -578,6 +578,9 @@ class PromoSField extends SField
     function get_request()
     {
         parent::get_request();
+        if (preg_match('/^[0-9]{2}$/', $this->value)){
+            $this->value = intval($this->value) + 1900;
+        }
         if (!(empty($this->value) or preg_match('/^[0-9]{4}$/', $this->value))) {
             new ThrowError('La promotion est une année à quatre chiffres.');
         }