mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Fixed validation test
This commit is contained in:
1 parent
0736abf50e
commit
08a831c141
3 files changed
+5
-8
No files matched your search
@@ -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');
|
||||
}
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user