From e46d663d7489a32e0774e3ce47b907ad0e2f0db3 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 6 Jul 2026 03:06:24 +0000 Subject: [PATCH] fix(geo): return raw country code without locale-dictionary validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously getCountryCode() returned '--' when the raw code wasn't in Appwrite's locale translations dictionary, while isEmpty() checked the raw stored value — the mismatch let the console country denylist silently bypass any country not translated in Appwrite (Antarctica, recently-created ISO codes, etc.). Country code is a machine-readable identifier; locale translation is only relevant for getCountryName(). --- src/Appwrite/Locale/GeoRecord.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/Appwrite/Locale/GeoRecord.php b/src/Appwrite/Locale/GeoRecord.php index 90477666b0..0e88ecb2d5 100644 --- a/src/Appwrite/Locale/GeoRecord.php +++ b/src/Appwrite/Locale/GeoRecord.php @@ -49,17 +49,7 @@ class GeoRecord extends Document { $code = $this->getAttribute('countryCode', '--'); - if ($code === '--') { - return '--'; - } - - $upper = \strtoupper($code); - - if ($this->locale === null) { - return $upper; - } - - return $this->locale->getText('countries.' . \strtolower($upper), false) ? $upper : '--'; + return $code === '--' ? '--' : \strtoupper($code); } public function getCountryName(): string