In order to mitigate against the brute force attacks against Gitlab accounts, we are moving to all edu-ID Logins. We would like to remind you to link your account with your edu-id. Login will be possible only by edu-ID after November 30, 2021. Here you can find the instructions for linking your account.

If you don't have a SWITCH edu-ID, you can create one with this guide here

kind regards

Commit 81f96da8 authored by haemmer's avatar haemmer
Browse files

Did some refactoring

parent 06b1e01e
......@@ -394,8 +394,8 @@ function isIPinCIDRBlock($cidr, $ip) {
list ($net, $mask) = split ("/", $cidr);
// Convert to binary string value of 1s and 0s
$netAsBinary = ip2bin($net);
$ipAsBinary = ip2bin($ip);
$netAsBinary = convertIPtoBinaryForm($net);
$ipAsBinary = convertIPtoBinaryForm($ip);
// Return false if netmask and ip are using different protocols
if (strlen($netAsBinary) != strlen($ipAsBinary)){
......@@ -418,7 +418,7 @@ function isIPinCIDRBlock($cidr, $ip) {
// Converts IP in human readable format to binary string
function ip2bin($ip){
function convertIPtoBinaryForm($ip){
// Handle IPv4 IP
if(filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false){
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment