mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-28 15:27:24 +08:00
fix get_ip_location_from_geoip() missing continent_en
This commit is contained in:
@@ -5885,6 +5885,7 @@ function get_ip_location_from_geoip($ip): bool|array
|
|||||||
'city' => '',
|
'city' => '',
|
||||||
'country_en' => '',
|
'country_en' => '',
|
||||||
'city_en' => '',
|
'city_en' => '',
|
||||||
|
'continent_en' => '',
|
||||||
];
|
];
|
||||||
try {
|
try {
|
||||||
$database = nexus_env('GEOIP2_DATABASE');
|
$database = nexus_env('GEOIP2_DATABASE');
|
||||||
@@ -5913,7 +5914,7 @@ function get_ip_location_from_geoip($ip): bool|array
|
|||||||
$info['continent'] = $continentName;
|
$info['continent'] = $continentName;
|
||||||
$info['continent_en'] = $record->continent->names['en'] ?? '';
|
$info['continent_en'] = $record->continent->names['en'] ?? '';
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
do_log($exception->getMessage());
|
do_log($exception->getMessage() . ", trace: " . $exception->getTraceAsString(), 'error');
|
||||||
}
|
}
|
||||||
return $info;
|
return $info;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user