include/sfx2/objsh.hxx | 2 ++ sfx2/source/doc/objmisc.cxx | 6 +----- sfx2/source/notify/eventsupplier.cxx | 18 ++++++++++++------ 3 files changed, 15 insertions(+), 11 deletions(-)
New commits: commit 70d022f6f134e67ffa9e65ca2a6de64e458a7db0 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Jul 23 15:31:05 2019 +0100 Commit: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> CommitDate: Tue Jul 30 14:36:54 2019 +0200 expand LibreLogo check to global events Change-Id: I7f436983ba0eb4b76b02d08ee52626e54b103d5f Reviewed-on: https://gerrit.libreoffice.org/76194 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@cib.de> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> (cherry picked from commit 85cbe1f06703c0b8e1f15a3d969202d99c66f34b) Reviewed-on: https://gerrit.libreoffice.org/76540 Reviewed-by: Stephan Bergmann <sberg...@redhat.com> Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index eaa93afd72da..d982aa1d20d7 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -392,6 +392,8 @@ public: */ bool AdjustMacroMode(); + static bool UnTrustedScript(const OUString& rScriptURL); + SvKeyValueIterator* GetHeaderAttributes(); void ClearHeaderAttributesForSourceViewHack(); void SetHeaderAttributesForSourceViewHack(); diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index d44b55e6b753..0e188b925784 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -1344,16 +1344,12 @@ namespace } } -namespace { - // don't allow LibreLogo to be used with our mouseover/etc dom-alike events -bool UnTrustedScript(const OUString& rScriptURL) +bool SfxObjectShell::UnTrustedScript(const OUString& rScriptURL) { return rScriptURL.startsWithIgnoreAsciiCase("vnd.sun.star.script:LibreLogo"); } -} - ErrCode SfxObjectShell::CallXScript( const Reference< XInterface >& _rxScriptContext, const OUString& _rScriptURL, const Sequence< Any >& aParams, Any& aRet, Sequence< sal_Int16 >& aOutParamIndex, Sequence< Any >& aOutParam, bool bRaiseError, const css::uno::Any* pCaller ) { diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx index 0be25c894451..b434122ed789 100644 --- a/sfx2/source/notify/eventsupplier.cxx +++ b/sfx2/source/notify/eventsupplier.cxx @@ -206,18 +206,24 @@ void SfxEvents_Impl::Execute( uno::Any const & aEventData, const document::Docum else if (aType == "Service" || aType == "Script") { - if ( !aScript.isEmpty() ) + bool bAllowed = false; + util::URL aURL; + if (!aScript.isEmpty()) { - SfxViewFrame* pView = pDoc ? - SfxViewFrame::GetFirst( pDoc ) : - SfxViewFrame::Current(); - uno::Reference < util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) ); - util::URL aURL; aURL.Complete = aScript; xTrans->parseStrict( aURL ); + bAllowed = !SfxObjectShell::UnTrustedScript(aURL.Complete); + } + + if (bAllowed) + { + SfxViewFrame* pView = pDoc ? + SfxViewFrame::GetFirst( pDoc ) : + SfxViewFrame::Current(); + uno::Reference < frame::XDispatchProvider > xProv; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits