Should fix geoloc.
[platal.git] / include / xorg.misc.inc.php
index 0f5bae9..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) {
@@ -315,8 +318,10 @@ function check_redirect($red = null)
     if (is_null($red)) {
         $red = new Redirect(S::v('uid'));
     }
-    $_SESSION['no_redirect'] = !$red->other_active('');
-    $_SESSION['mx_failures'] = $red->get_broken_mx();
+    if ($red->get_uid() == S::v('uid')) {
+        $_SESSION['no_redirect'] = !$red->other_active('');
+        $_SESSION['mx_failures'] = $red->get_broken_mx();
+    }
 }
 
 function send_warning_mail($title)