Don't try to convert non-IP to uint.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 7 Jun 2008 14:48:19 +0000 (16:48 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 7 Jun 2008 14:50:22 +0000 (16:50 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
include/xorg.misc.inc.php

index b025e7a..eefbfb2 100644 (file)
@@ -235,6 +235,9 @@ function make_forlife($prenom, $nom, $promo)
 function ip_to_uint($ip)
 {
     $part = explode('.', $ip);
+    if (count($part) != 4) {
+        return null;
+    }
     $v = 0;
     $fact = 0x1000000;
     for ($i = 0 ; $i < 4 ; ++$i) {