diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e8f9208e..e08fec6aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ 1. [](#bugfix) * Force question to install demo content in theme update [#2493](https://github.com/getgrav/grav/issues/2493) * Fixed GPM errors from blueprints not being logged [#2505](https://github.com/getgrav/grav/issues/2505) + * Don't error when IP is invalid [#2507](https://github.com/getgrav/grav/issues/2507) # v1.6.9 ## 05/09/2019 diff --git a/system/src/Grav/Common/Utils.php b/system/src/Grav/Common/Utils.php index ad9b289f3..9b0992f99 100644 --- a/system/src/Grav/Common/Utils.php +++ b/system/src/Grav/Common/Utils.php @@ -1494,12 +1494,11 @@ abstract class Utils * @param int $prefix * * @return string - * @throws \InvalidArgumentException if provided an invalid IP */ public static function getSubnet($ip, $prefix = 64) { if (!filter_var($ip, FILTER_VALIDATE_IP)) { - throw new \InvalidArgumentException('Invalid IP: ' . $ip); + return $ip; } // Packed representation of IP