From: Stéphane Jacob Date: Mon, 22 Feb 2010 23:04:13 +0000 (+0100) Subject: Improves getXorgId. X-Git-Tag: xorg/1.0.0~332^2~176 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=a292484d6d19447f6cc3c10d573338b3275fbc74;p=platal.git Improves getXorgId. Signed-off-by: Stéphane Jacob --- diff --git a/classes/profile.php b/classes/profile.php index 63da84c..8ebf639 100644 --- a/classes/profile.php +++ b/classes/profile.php @@ -642,6 +642,10 @@ class Profile public static function getXorgId($schoolId) { + if (!preg_match('/^[0-9]{6}$/', $xorgId)) { + return null; + } + $year = intval(substr($schoolId, 0, 3)); $rank = intval(substr($schoolId, 3, 3));