This is an automated email from the ASF dual-hosted git repository.
ardovm pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/trunk by this push:
new 040baae653 Additional check
040baae653 is described below
commit 040baae65323da00a837571412055ec32f31a97c
Author: Arrigo Marchiori <[email protected]>
AuthorDate: Sat Jul 18 16:34:37 2026 +0200
Additional check
---
main/sc/source/ui/docshell/dbdocimp.cxx | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/main/sc/source/ui/docshell/dbdocimp.cxx
b/main/sc/source/ui/docshell/dbdocimp.cxx
index d62fe28f6b..92c5d6240e 100644
--- a/main/sc/source/ui/docshell/dbdocimp.cxx
+++ b/main/sc/source/ui/docshell/dbdocimp.cxx
@@ -32,9 +32,11 @@
#include <comphelper/types.hxx>
#include <vcl/msgbox.hxx>
#include <tools/debug.hxx>
+#include <tools/urlobj.hxx>
#include <svx/dataaccessdescriptor.hxx>
#include <sfx2/viewfrm.hxx>
+#include <com/sun/star/document/XLinkAuthorizer.hpp>
#include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/sdb/XCompletedExecution.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
@@ -138,6 +140,14 @@ sal_Bool ScDBDocFunc::DoImport( SCTAB nTab, const
ScImportParam& rParam,
{
ScDocument* pDoc = rDocShell.GetDocument();
+ INetURLObject aURL( rParam.aDBName );
+ if ( aURL.GetProtocol() != INET_PROT_NOT_VALID ) {
+ ::com::sun::star::uno::Reference<
::com::sun::star::document::XLinkAuthorizer > xLinkAuthorizer(
pDoc->GetDocumentShell()->GetModel(), ::com::sun::star::uno::UNO_QUERY );
+ if ( xLinkAuthorizer.is() && ! xLinkAuthorizer->authorizeLinks(
rParam.aDBName ) ) {
+ return sal_False;
+ }
+ }
+
if (bRecord && !pDoc->IsUndoEnabled())
bRecord = sal_False;