From a4e0eaaba45a4629bc92ea7ed025924578956f3c Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Tue, 14 Oct 2025 11:43:43 -0400 Subject: [PATCH] Style configurator: Log error and discard invalid locale values --- chrome/content/zotero/elements/styleConfigurator.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/chrome/content/zotero/elements/styleConfigurator.js b/chrome/content/zotero/elements/styleConfigurator.js index 278a0a4f0d..4e950fca36 100644 --- a/chrome/content/zotero/elements/styleConfigurator.js +++ b/chrome/content/zotero/elements/styleConfigurator.js @@ -107,6 +107,15 @@ } set value(val) { + try { + // eslint-disable-next-line no-new + new Intl.Locale(val); + } + catch (e) { + Zotero.logError(e); + val = ''; + } + this._value = val; const styleData = this._style ? Zotero.Styles.get(this._style) : null; this.localeListEl.value = styleData && styleData.locale || this._value;