From d3c5be4f56c279485742d203f5a80391ccc000b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 15 Aug 2021 11:56:20 +0200 Subject: [PATCH] ip-location: if data is not downloaded, skip initialization --- src/ip-location.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ip-location.php b/src/ip-location.php index e3b3656f..571f34a2 100644 --- a/src/ip-location.php +++ b/src/ip-location.php @@ -8,6 +8,11 @@ register_hook('init', function () { return; } + if (!file_exists('data/GeoIP/GeoLite2-City.mmdb')) { + $config['checkIpLocation'] = false; + return; + } + $reader = new Reader('data/GeoIP/GeoLite2-City.mmdb'); try {