mirror of
https://github.com/flatpak/flatpak.git
synced 2026-09-12 22:22:09 -04:00
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:
1 parent
c771d52887
commit
d2f364bbd7
1 file changed
+6
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user