sc/source/ui/docshell/docsh4.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 7f8b22df80a29b1cb787ca78d3112f62e550632e
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Thu Jun 13 15:47:07 2024 +0200
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Thu Jun 13 20:55:35 2024 +0200

    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.bergm...@allotropia.de>

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()

Reply via email to