diff --git a/library/attach_mod/includes/functions_attach.php b/library/attach_mod/includes/functions_attach.php index ebfc48bcb..e2d7bc67a 100644 --- a/library/attach_mod/includes/functions_attach.php +++ b/library/attach_mod/includes/functions_attach.php @@ -342,7 +342,7 @@ function _set_var(&$result, $var, $type, $multibyte = false) * @param $var_name * @param $default * @param bool $multibyte - * @return array + * @return array|string */ function get_var($var_name, $default, $multibyte = false) { diff --git a/library/includes/functions.php b/library/includes/functions.php index 943648d29..e490ad930 100644 --- a/library/includes/functions.php +++ b/library/includes/functions.php @@ -2218,9 +2218,16 @@ function infoByIP(string $ipAddress, int $port = 0): array 'continent' => $json['continent'], 'continentCode' => $json['continentCode'] ]; - CACHE('bb_ip2countries')->set($cacheName, $data, 1200); } } + + if (empty($data)) { + $data = [ + 'response' => false, + 'timestamp' => TIMENOW + ]; + } + CACHE('bb_ip2countries')->set($cacheName, $data, 1200); } return $data;