From e772b41735cc5bdc444f8e3df7e3b63e7d02d6f7 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Mon, 7 Jun 2021 23:08:56 +0800 Subject: [PATCH] improve check geoip2 database --- include/functions.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/functions.php b/include/functions.php index b8605fce..6e7a1c90 100644 --- a/include/functions.php +++ b/include/functions.php @@ -5017,8 +5017,12 @@ function can_access_torrent($torrent) function get_ip_location_from_geoip($ip) { $database = nexus_env('GEOIP2_DATABASE'); - if (empty($database) || !is_readable($database)) { - do_log("no geoip2 database or $database is nor is not readable."); + if (empty($database)) { + do_log("no geoip2 database."); + return false; + } + if (!is_readable($database)) { + do_log("geoip2 database: $database is not readable."); return false; } static $reader;