This is an automated email from the ASF dual-hosted git repository. ardovm pushed a commit to branch AOO42X in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 518a110c8f0ef6164d375a1a56fbef59859cf6f0 Author: Arrigo Marchiori <[email protected]> AuthorDate: Sun Jun 15 20:50:53 2025 +0200 SvxXMLListStyleContext validates URLs (cherry picked from commit 6248bb998bfffba488f8b0042e7fd13ea536cac7) --- main/xmloff/source/style/xmlnumi.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/main/xmloff/source/style/xmlnumi.cxx b/main/xmloff/source/style/xmlnumi.cxx index 4b8d9d56ed..6453cce38d 100644 --- a/main/xmloff/source/style/xmlnumi.cxx +++ b/main/xmloff/source/style/xmlnumi.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/awt/Size.hpp> #include <com/sun/star/awt/FontDescriptor.hpp> +#include <com/sun/star/document/XLinkAuthorizer.hpp> #include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/VertOrientation.hpp> // --> OD 2008-01-16 #newlistlevelattrs# @@ -1216,6 +1217,18 @@ void SvxXMLListStyleContext::FillUnoNumRule( pLevelStyle->GetProperties( pI18NMap ); Any aAny; aAny <<= aProps; + // Validate any URLs + for( sal_Int32 j = 0; j < aProps.getLength(); j++ ) { + if ( aProps[ j ].Name.equalsAscii( "GraphicURL" ) ) { + OUString aURL; + aProps[ j ].Value >>= aURL; + uno::Reference< com::sun::star::document::XLinkAuthorizer > xLinkAuthorizer( GetImport().GetModel(), uno::UNO_QUERY ); + if ( xLinkAuthorizer.is() ) { + if ( !xLinkAuthorizer->authorizeLinks( aURL ) ) + throw uno::RuntimeException(); + } + } + } rNumRule->replaceByIndex( nLevel, aAny ); } }
