diff options
Diffstat (limited to 'desktop/source/lib/init.cxx')
-rw-r--r-- | desktop/source/lib/init.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index abde59b9b5c6..0d80378f7c31 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -2239,8 +2239,9 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis, // not pass it as a parameter to the filter OUString aOptions = getUString(pOptions); const OUString aLanguage = extractParameter(aOptions, "Language"); + bool isValidLangTag = LanguageTag::isValidBcp47(aLanguage, nullptr); - if (!aLanguage.isEmpty()) + if (!aLanguage.isEmpty() && isValidLangTag) { SfxLokHelper::setDefaultLanguage(aLanguage); // Set the LOK language tag, used for dialog tunneling. |