summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-07-17 09:08:51 +0100
committerEike Rathke <erack@redhat.com>2018-07-18 21:21:23 +0200
commit6f521b2d4e2a68d29839012f73dec45e68aeaef1 (patch)
treebc460c27e91f2e844ee1a4f75454ad54f292b943 /sfx2
parent72dc4c2633fb866cc8b42dc742bffc57c23e9889 (diff)
bubble referer to LinkManager::GetGraphicFromAny
Change-Id: Id2c6d629692a365f96f3f81c5686930668389a6a Reviewed-on: https://gerrit.libreoffice.org/57549 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/linkmgr2.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index 64e89a927f12..b503e06f0cf6 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -40,6 +40,7 @@
#include <sfx2/request.hxx>
#include <vcl/dibtools.hxx>
#include <unotools/charclass.hxx>
+#include <unotools/securityoptions.hxx>
#include <vcl/GraphicLoader.hxx>
#include "fileobj.hxx"
@@ -497,9 +498,10 @@ SotClipboardFormatId LinkManager::RegisterStatusInfoId()
return nFormat;
}
-bool LinkManager::GetGraphicFromAny( const OUString& rMimeType,
- const css::uno::Any & rValue,
- Graphic& rGraphic )
+bool LinkManager::GetGraphicFromAny(const OUString& rMimeType,
+ const css::uno::Any & rValue,
+ const OUString& rReferer,
+ Graphic& rGraphic )
{
bool bRet = false;
@@ -509,7 +511,8 @@ bool LinkManager::GetGraphicFromAny( const OUString& rMimeType,
if (rValue.has<OUString>())
{
OUString sURL = rValue.get<OUString>();
- rGraphic = vcl::graphic::loadFromURL(sURL);
+ if (!SvtSecurityOptions().isUntrustedReferer(rReferer))
+ rGraphic = vcl::graphic::loadFromURL(sURL);
if (!rGraphic)
rGraphic.SetDefaultType();
rGraphic.setOriginURL(sURL);