mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-26 05:17:22 +08:00
improve check geoip2 database
This commit is contained in:
@@ -5017,8 +5017,12 @@ function can_access_torrent($torrent)
|
|||||||
function get_ip_location_from_geoip($ip)
|
function get_ip_location_from_geoip($ip)
|
||||||
{
|
{
|
||||||
$database = nexus_env('GEOIP2_DATABASE');
|
$database = nexus_env('GEOIP2_DATABASE');
|
||||||
if (empty($database) || !is_readable($database)) {
|
if (empty($database)) {
|
||||||
do_log("no geoip2 database or $database is nor is not readable.");
|
do_log("no geoip2 database.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!is_readable($database)) {
|
||||||
|
do_log("geoip2 database: $database is not readable.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
static $reader;
|
static $reader;
|
||||||
|
|||||||
Reference in New Issue
Block a user