Skip to content

Commit

Permalink
fix missing string cast causing deprecated explode call (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFireMike authored Jan 30, 2024
1 parent b59c13f commit 8abc770
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/Netbox/ProvidedHook/Director/ImportSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ private function get_ip_range($ranges, $things)
private function ip_in_range($lower_range_ip_address, $upper_range_ip_address, $needle_ip_address)
{
# Get the numeric reprisentation of the IP Address with IP2long
$min = ip2long(explode('/', $lower_range_ip_address)[0]);
$max = ip2long(explode('/', $upper_range_ip_address)[0]);
$needle = ip2long(explode('/', $needle_ip_address)[0]);
$min = ip2long(explode('/', (string)$lower_range_ip_address)[0]);
$max = ip2long(explode('/', (string)$upper_range_ip_address)[0]);
$needle = ip2long(explode('/', (string)$needle_ip_address)[0]);

return (($needle >= $min) AND ($needle <= $max));
}
Expand Down

0 comments on commit 8abc770

Please sign in to comment.