From: Aymeric Augustin Date: Sun, 9 Mar 2008 16:41:41 +0000 (+0100) Subject: Fix bug when user entered a birthdate on 2 digits during regisstration X-Git-Tag: xorg/0.9.16~129 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=7caaaf6db128050b5151c8133e5719df6ec1cab2;p=platal.git Fix bug when user entered a birthdate on 2 digits during regisstration --- diff --git a/modules/register.php b/modules/register.php index 69a8ae5..ee95c8f 100644 --- a/modules/register.php +++ b/modules/register.php @@ -148,8 +148,10 @@ class RegisterModule extends PLModule $err[] = "La 'Date de naissance' n'est pas correcte."; } else { $birth = explode('/', $birth, 3); - $year = intval($birth[2]); - if ($year < 100) $year += 1900; + for ($i = 0; $i < 3; $i++) + $birth[$i] = intval($birth[$i]); + if ($birth[2] < 100) $birth[2] += 1900; + $year = $birth[2]; $promo = (int)$sub_state['promo']; if ($year > $promo - 15 || $year < $promo - 30) { $err[] = "La 'Date de naissance' n'est pas correcte.";