Verified Commit 7a3f5d85 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃
Browse files

Bug 40309: Avoid using regional OS locales

Avoid regional OS locales if the pref
`intl.regional_prefs.use_os_locales` is false but RFP is enabled.
parent cbd37725
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
#include "mozilla/intl/AppDateTimeFormat.h"
#include "mozilla/intl/Locale.h"
#include "mozilla/intl/OSPreferences.h"
#include "nsContentUtils.h"
#include "nsDirectoryService.h"
#include "nsDirectoryServiceDefs.h"
#include "nsIObserverService.h"
@@ -484,6 +485,11 @@ LocaleService::GetAppLocaleAsBCP47(nsACString& aRetVal) {

NS_IMETHODIMP
LocaleService::GetRegionalPrefsLocales(nsTArray<nsCString>& aRetVal) {
  if (nsContentUtils::ShouldResistFingerprinting()) {
    GetAppLocalesAsBCP47(aRetVal);
    return NS_OK;
  }

  bool useOSLocales =
      Preferences::GetBool("intl.regional_prefs.use_os_locales", false);