summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <stephan.bergmann@allotropia.de>2024-06-13 15:47:07 +0200
committerStephan Bergmann <stephan.bergmann@allotropia.de>2024-06-13 20:55:35 +0200
commit7f8b22df80a29b1cb787ca78d3112f62e550632e (patch)
treeaeef5addc0b45c04d378f7da13dad78e0c5dca2d
parent2b250d2dbfa907a2eb571c5c4cb36b00c908bdc6 (diff)
Let ScDocShell::GetLinkUpdateModeState honor isUntrustedReferer
Change-Id: I358911ad5180548767eadac3d15d0583598fe5e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168814 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
-rw-r--r--sc/source/ui/docshell/docsh4.cxx9
1 files changed, 8 insertions, 1 deletions
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()