Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Xon committed Feb 1, 2019
1 parent 8b0dea5 commit 240a860
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions upload/library/TPUDetectSpamReg/IPCountry.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,31 @@ static function getIPCountry($ip)
{
$response = $client->request('GET');
$body = $response->getBody();
$country=json_decode(body);
$country=json_decode($body);
if (isset($country) && isset($country->countryCode) && $country->countryCode!='')
{
return $country->countryCode;
}
}
} catch(Exception $e) {}

$client = XenForo_Helper_Http::getUntrustedClient('http://ip-api.com/json/'.$ip);
try
{
$response = $client->request('GET');
$body = $response->getBody();
$country=json_decode(body);
$country=json_decode($body);
if (isset($country) && isset($country->countryCode) && $country->countryCode!='')
{
return $country->countryCode;
}
} catch(Exception $e) {}

$client = XenForo_Helper_Http::getUntrustedClient(https://api.ipstack.com/{$ip}?output=json&fields=country_code");
$client = XenForo_Helper_Http::getUntrustedClient("https://api.ipstack.com/{$ip}?output=json&fields=country_code");
try
{
$response = $client->request('GET');
$body = $response->getBody();
$country=json_decode(body);
$country=json_decode($body);
if (isset($country) && isset($country->country_code) && $country->country_code!='')
{
return $country->country_code;
Expand Down

0 comments on commit 240a860

Please sign in to comment.