Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-29551 Fixing ip_in_range function

  • Loading branch information...
commit 3ab2851d2a59721445945d0706c58092e07e861e 1 parent 012a51e
Patrick Mcneill authored ankitagarwal committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 mnet/lib.php
View
4 mnet/lib.php
@@ -412,10 +412,10 @@ function ip_in_range($address, $network, $mask) {
$lnetwork = ip2long($network);
$laddress = ip2long($address);
- $binnet = str_pad( decbin($lnetwork),32,"0","STR_PAD_LEFT" );
+ $binnet = str_pad( decbin($lnetwork), 32, "0", STR_PAD_LEFT );
$firstpart = substr($binnet,0,$mask);
- $binip = str_pad( decbin($laddress),32,"0","STR_PAD_LEFT" );
+ $binip = str_pad( decbin($laddress), 32, "0", STR_PAD_LEFT );
$firstip = substr($binip,0,$mask);
return(strcmp($firstpart,$firstip)==0);
}
Please sign in to comment.
Something went wrong with that request. Please try again.