Fixed validation test

This commit is contained in:
Eldad Fux committed 2020-10-25 11:27:07 +02:00
1 parent 0736abf50e
commit 08a831c141
3 files changed
+5 -8

No files matched your search

+1 -1
View File
@@ -641,7 +641,7 @@ App::get('/v1/account/sessions')
try {
$record = $geodb->get($token->getAttribute('ip', ''));
if (isset($record)){
if ($record) {
$sessions[$index]['geo']['isoCode'] = \strtolower($record['country']['iso_code']);
$sessions[$index]['geo']['country'] = (isset($countries[$record['country']['iso_code']])) ? $countries[$record['country']['iso_code']] : $locale->getText('locale.country.unknown');
}
+3 -6
View File
@@ -29,12 +29,9 @@ App::get('/v1/locale')
$currency = null;
try {
$record = $geodb->get($ip);
var_dump('record');
var_dump($record);
$record = $geodb->get($ip);
if($record) {
$output['countryCode'] = $record['country']['iso_code'];
$output['country'] = (isset($countries[$record['country']['iso_code']])) ? $countries[$record['country']['iso_code']] : $locale->getText('locale.country.unknown');
$output['continent'] = (isset($continents[$record['continent']['code']])) ? $continents[$record['continent']['code']] : $locale->getText('locale.country.unknown');
@@ -48,7 +45,7 @@ App::get('/v1/locale')
}
$output['currency'] = $currency;
} catch (\Exception $e) {
} else {
$output['countryCode'] = '--';
$output['country'] = $locale->getText('locale.country.unknown');
$output['continent'] = $locale->getText('locale.country.unknown');
+1 -1
View File
@@ -272,7 +272,7 @@ App::get('/v1/users/:userId/sessions')
try {
$record = $geodb->get($token->getAttribute('ip', ''));
if (isset($record)) {
if ($record) {
$sessions[$index]['geo']['isoCode'] = \strtolower($record['country']['iso_code']);
$sessions[$index]['geo']['country'] = (isset($countries[$record['country']['iso_code']])) ? $countries[$record['country']['iso_code']] : $locale->getText('locale.country.unknown');
} else {