From 94caebadeb66ad7b453d4258a796979cafb758b0 Mon Sep 17 00:00:00 2001 From: cassiopc Date: Fri, 9 Nov 2012 13:53:58 +0100 Subject: fixes issue with IP numbers of teams --- boca-1.5.2/src/globals.php | 17 +++++++++-------- boca-1.5.2/tools/icpc.etc.tgz | Bin 9525 -> 9525 bytes 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/boca-1.5.2/src/globals.php b/boca-1.5.2/src/globals.php index 66047ef..1d07ba1 100755 --- a/boca-1.5.2/src/globals.php +++ b/boca-1.5.2/src/globals.php @@ -15,7 +15,7 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . //////////////////////////////////////////////////////////////////////////////// -// Last modified 21/jul/2012 by cassio@ime.usp.br +// Last modified 09/nov/2012 by cassio@ime.usp.br require_once('db.php'); define("dbcompat_1_4_1",true); @@ -311,13 +311,14 @@ function match_network ($nets, $ip) { $ip_arr = explode('/', $net); $net_long = ip2long(trim($ip_arr[0])); - if(trim($ip_arr[1]) != '') { - $x = ip2long(trim($ip_arr[1])); - $mask = long2ip($x) == ((int) trim($ip_arr[1])) ? $x : 0xffffffff << (32 - ((int) trim($ip_arr[1]))); - } else { $mask=0xffffffff; - } - $ip_long = ip2long($ip); - + if(trim($ip_arr[1]) != '') { + $x = ip2long(trim($ip_arr[1])); + $mask = long2ip($x) == ((int) trim($ip_arr[1])) ? $x : 0xffffffff << (32 - ((int) trim($ip_arr[1]))); + } else { + $mask=0xffffffff; + } + $ip_long = ip2long($ip); + if ($rev) { if (($ip_long & $mask) != ($net_long & $mask)) return true; } else { diff --git a/boca-1.5.2/tools/icpc.etc.tgz b/boca-1.5.2/tools/icpc.etc.tgz index 0f7a4e6..e58e2b1 100644 Binary files a/boca-1.5.2/tools/icpc.etc.tgz and b/boca-1.5.2/tools/icpc.etc.tgz differ -- cgit v1.2.3