From 7f8b22df80a29b1cb787ca78d3112f62e550632e Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 13 Jun 2024 15:47:07 +0200 Subject: Let ScDocShell::GetLinkUpdateModeState honor isUntrustedReferer Change-Id: I358911ad5180548767eadac3d15d0583598fe5e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168814 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- sc/source/ui/docshell/docsh4.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index c1ee001cf393..24a64345b759 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -151,7 +151,14 @@ ScLkUpdMode ScDocShell::GetLinkUpdateModeState() const } } - if (nSet == LM_ALWAYS + if (nSet != LM_NEVER + && (SvtSecurityOptions::isUntrustedReferer( + GetMedium() == nullptr ? OUString() : GetMedium()->GetName()) + || (IsDocShared() && SvtSecurityOptions::isUntrustedReferer(GetSharedFileURL())))) + { + nSet = LM_NEVER; + } + else if (nSet == LM_ALWAYS && !(SvtSecurityOptions::isTrustedLocationUriForUpdatingLinks( GetMedium() == nullptr ? OUString() : GetMedium()->GetName()) || (IsDocShared() -- cgit