summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2020-10-23 01:35:41 +0300
committerGülşah Köse <gulsah.kose@collabora.com>2020-10-23 16:34:40 +0200
commit9c0ca63f2eba1732403c13dd6571c2336fd3bdaf (patch)
tree20e75837936b64a7a8fe92f16c39110f2218f409 /desktop
parent508daea752c1d9c44474abcee43168fc12657541 (diff)
Prevent crash with invalid lang tag.
Change-Id: I778b5b007d4edce946e8b4c26e5a07f12103a968 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104707 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 1acdbd58841b..94e34cf9dca5 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2227,8 +2227,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.