MozillaFirefox/mozilla-language.patch
Wolfgang Rosenauer 944690d724 - update to Firefox 51.0
* requires NSPR >= 4.13.1, NSS >= 3.28.1
  * Added support for FLAC (Free Lossless Audio Codec) playback
  * Added support for WebGL 2
  * Added Georgian (ka) and Kabyle (kab) locales
  * Support saving passwords for forms without 'submit' events
  * Improved video performance for users without GPU acceleration
  * Zoom indicator is shown in the URL bar if the zoom level is not
    at default level
  * View passwords from the prompt before saving them
  * Remove Belarusian (be) locale
  * Use Skia for content rendering (Linux)
  * MFSA 2017-01
    CVE-2017-5375: Excessive JIT code allocation allows bypass of
                   ASLR and DEP (bmo#1325200, boo#1021814)
    CVE-2017-5376: Use-after-free in XSL (bmo#1311687, boo#1021817)
    CVE-2017-5377: Memory corruption with transforms to create
                   gradients in Skia (bmo#1306883, boo#1021826)
    CVE-2017-5378: Pointer and frame data leakage of Javascript objects
                   (bmo#1312001, bmo#1330769, boo#1021818)
    CVE-2017-5379: Use-after-free in Web Animations
                   (bmo#1309198,boo#1021827)
    CVE-2017-5380: Potential use-after-free during DOM manipulations
                   (bmo#1322107, boo#1021819)
    CVE-2017-5390: Insecure communication methods in Developer Tools
                   JSON viewer (bmo#1297361, boo#1021820)
    CVE-2017-5389: WebExtensions can install additional add-ons via
                   modified host requests (bmo#1308688, boo#1021828)
    CVE-2017-5396: Use-after-free with Media Decoder
                   (bmo#1329403, boo#1021821)

OBS-URL: https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox?expand=0&rev=567
2017-01-25 10:27:08 +00:00

65 lines
2.4 KiB
Diff

# HG changeset patch
# User Wolfgang Rosenauer <wr@rosenauer.org>
# Parent 5a29924228527f8882c83cf62d470963ea1ce62e
# Parent 4f39ed617c2f151a3a15903c7ae4471b66774e9e
Bug 583793 - Firefox interface language set to LANG, ignores LANGUAGE
diff --git a/intl/locale/nsLocaleService.cpp b/intl/locale/nsLocaleService.cpp
--- a/intl/locale/nsLocaleService.cpp
+++ b/intl/locale/nsLocaleService.cpp
@@ -114,16 +114,17 @@ nsLocaleService::nsLocaleService(void)
NS_ENSURE_SUCCESS_VOID(rv);
#endif
#if defined(XP_UNIX) && !defined(XP_MACOSX)
RefPtr<nsLocale> resultLocale(new nsLocale());
NS_ENSURE_TRUE_VOID(resultLocale);
// Get system configuration
const char* lang = getenv("LANG");
+ const char* language = getenv("LANGUAGE");
nsAutoString xpLocale, platformLocale;
nsAutoString category, category_platform;
int i;
for( i = 0; i < LocaleListLength; i++ ) {
nsresult result;
// setlocale( , "") evaluates LC_* and LANG
@@ -149,16 +150,36 @@ nsLocaleService::nsLocaleService(void)
} else {
CopyASCIItoUTF16(lang, platformLocale);
result = nsPosixLocale::GetXPLocale(lang, xpLocale);
}
}
if (NS_FAILED(result)) {
return;
}
+ // LANGUAGE is overriding LC_MESSAGES
+ // it can be a colon separated list of preferred languages
+ // as we do not recognize here if a language is available
+ // we actually only consider the first entry unless GetXPLocale
+ // fails completely
+ if (i == LC_MESSAGES && language && *language) {
+#define LANGUAGE_SEP ":"
+ nsAutoString xpLocale_temp;
+ char* rawBuffer = (char*) language;
+ char* token = nsCRT::strtok(rawBuffer, LANGUAGE_SEP, &rawBuffer);
+ for (; token;
+ token = nsCRT::strtok(rawBuffer, LANGUAGE_SEP, &rawBuffer)) {
+ result = nsPosixLocale::GetXPLocale(token, xpLocale_temp);
+ if (NS_SUCCEEDED(result)) {
+ CopyASCIItoUTF16(token, platformLocale);
+ xpLocale = xpLocale_temp;
+ break;
+ }
+ }
+ }
resultLocale->AddCategory(category, xpLocale);
resultLocale->AddCategory(category_platform, platformLocale);
}
mSystemLocale = do_QueryInterface(resultLocale);
mApplicationLocale = do_QueryInterface(resultLocale);
#endif // XP_UNIX