Skip to content

Commit

Permalink
fix based on dsoares#46
Browse files Browse the repository at this point in the history
  • Loading branch information
pbiering committed Mar 12, 2023
1 parent 18b5b21 commit 9ee3b54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rcguard.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,8 @@ private function get_client_ip()
// construct subnet mask
$mask_string = str_repeat('1', $prefix) . str_repeat('0', 128 - $prefix);
$mask_split = str_split($mask_string, 16);
foreach ($mask_split as $item) {
$item = base_convert($item, 2, 16);
for ($i = 0; $i < count($mask_split); $i++) {
$mask_split[$i] = base_convert($mask_split[$i], 2, 16);
}
$mask_hex = implode(':', $mask_split);

Expand Down

0 comments on commit 9ee3b54

Please sign in to comment.