From a292484d6d19447f6cc3c10d573338b3275fbc74 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Tue, 23 Feb 2010 00:04:13 +0100 Subject: [PATCH] Improves getXorgId. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- classes/profile.php | 4 ++++ 1 file changed, 4 insertions(+) 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)); -- 2.1.4