diff --git a/src/Adyen/Util/IpAddress.php b/src/Adyen/Util/IpAddress.php index 18a9ba372..a077792fc 100644 --- a/src/Adyen/Util/IpAddress.php +++ b/src/Adyen/Util/IpAddress.php @@ -41,7 +41,12 @@ public function getAdyenIpAddresses() { $ipAddresses = array(); foreach (self::$HOSTNAMES as $hostname) { - $ipAddresses = array_merge($ipAddresses, gethostbynamel($hostname)); + $ipAddressesOfHostName = gethostbynamel($hostname); + + // gethostbynamel can return false if hostname could not be resolved + if (false !== $ipAddressesOfHostName) { + $ipAddresses = array_merge($ipAddresses, $ipAddressesOfHostName); + } } return $ipAddresses; }