locale-utils: Ensure the flatpak lang only contains a-zA-Z

This should be the case anyway right now and makes it easier to ensure
the code using it is correct.
This commit is contained in:
Sebastian Wick committed 2026-07-27 13:41:00 +00:00
1 parent c771d52887
commit d2f364bbd7
1 file changed
+6
+6
View File
@@ -64,6 +64,12 @@ flatpak_get_lang_from_locale (const char *locale)
if (strcmp (lang, "C") == 0)
return NULL;
for (c = lang; *c != 0; c++)
{
if (!g_ascii_isalpha (*c))
return NULL;
}
return g_steal_pointer (&lang);
}