From 045551c4e2979ba01b5fbeab50088109ba4b4d4b Mon Sep 17 00:00:00 2001 From: aknife1990 Date: Mon, 29 Apr 2024 15:25:46 +0800 Subject: [PATCH] update --- src/IpInfo.php | 4 ++-- test.php | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 test.php diff --git a/src/IpInfo.php b/src/IpInfo.php index fea5a1d..3411aeb 100644 --- a/src/IpInfo.php +++ b/src/IpInfo.php @@ -32,7 +32,7 @@ class IpInfo { $location = $reader->get($ip); $reader->close(); - if( $language && $location['continent'][$language] ){ + if( $language && isset($location['continent'][$language]) ){ $location = [ 'continent' => [ 'code' => $location['continent']['code'], @@ -61,4 +61,4 @@ class IpInfo { private static function dataPath() { return self::$databasePath ?: IP_DATABASE_DIR . '/data.mmdb'; } -} \ No newline at end of file +} diff --git a/test.php b/test.php new file mode 100644 index 0000000..ba9e9e6 --- /dev/null +++ b/test.php @@ -0,0 +1,6 @@ +