aboutsummaryrefslogtreecommitdiff
path: root/boca-1.5.2/src/globals.php
diff options
context:
space:
mode:
Diffstat (limited to 'boca-1.5.2/src/globals.php')
-rwxr-xr-xboca-1.5.2/src/globals.php17
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 {