diff --git a/app/controllers/shared/api/auth.php b/app/controllers/shared/api/auth.php index 7b65f8602c..a8ad13e043 100644 --- a/app/controllers/shared/api/auth.php +++ b/app/controllers/shared/api/auth.php @@ -52,8 +52,8 @@ Http::init() throw new Exception(Exception::GENERAL_REGION_ACCESS_DENIED); } - $countries = \array_map('strtolower', \array_map('trim', explode(',', $denylist))); - $country = strtolower($geoRecord->getCountryCode()); + $countries = \array_map('strtoupper', \array_map('trim', explode(',', $denylist))); + $country = \strtoupper($geoRecord->getCountryCode()); if (in_array($country, $countries, true)) { throw new Exception(Exception::GENERAL_REGION_ACCESS_DENIED); } diff --git a/src/Appwrite/Locale/GeoRecord.php b/src/Appwrite/Locale/GeoRecord.php index b05951ab51..90477666b0 100644 --- a/src/Appwrite/Locale/GeoRecord.php +++ b/src/Appwrite/Locale/GeoRecord.php @@ -53,13 +53,13 @@ class GeoRecord extends Document return '--'; } - $lower = \strtolower($code); + $upper = \strtoupper($code); if ($this->locale === null) { - return $lower; + return $upper; } - return $this->locale->getText('countries.' . $lower, false) ? $lower : '--'; + return $this->locale->getText('countries.' . \strtolower($upper), false) ? $upper : '--'; } public function getCountryName(): string