diff options
| author | cassiopc <cassiopc@gmail.com> | 2012-11-09 12:53:58 +0000 |
|---|---|---|
| committer | cassiopc <cassiopc@gmail.com> | 2012-11-09 12:53:58 +0000 |
| commit | 94caebadeb66ad7b453d4258a796979cafb758b0 (patch) | |
| tree | 0105db78b13aa970d3a88a514226a105971c89b1 /boca-1.5.2/src | |
| parent | ed3268aac571a73410da657c7b1318533e9c1f0f (diff) | |
| download | boca-94caebadeb66ad7b453d4258a796979cafb758b0.tar.gz boca-94caebadeb66ad7b453d4258a796979cafb758b0.zip | |
fixes issue with IP numbers of teams
Diffstat (limited to 'boca-1.5.2/src')
| -rwxr-xr-x | boca-1.5.2/src/globals.php | 17 |
1 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 <http://www.gnu.org/licenses/>. //////////////////////////////////////////////////////////////////////////////// -// 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 { |