Skip to content

Commit 530a3b7

Browse files
committed
PHP 8.1 compatibility bug fix.
1 parent 88308d8 commit 530a3b7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.DS_Store

0 Bytes
Binary file not shown.

src/WebServices/GeoPluginWebService.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ public function locate()
4545
"NA" => "North America",
4646
"SA" => "South America"
4747
];
48-
$continent_name = (isset($continents[strtoupper($data['geoplugin_continentCode'])])) ? $continents[strtoupper($data['geoplugin_continentCode'])] : null;
48+
49+
if (isset($data['geoplugin_continentCode']) && !empty($data['geoplugin_continentCode'])) {
50+
$continent_name = (isset($continents[strtoupper($data['geoplugin_continentCode'])])) ? $continents[strtoupper($data['geoplugin_continentCode'])] : null;
51+
} else {
52+
$continent_name = null;
53+
}
4954

5055
$geo_data = [
5156
'ip' => $this->ip,

0 commit comments

Comments
 (0)