diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2023-12-04 18:36:29 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2023-12-07 14:58:33 +0100 |
commit | 64624d225c71229acce4f889d4863d7c29c52658 (patch) | |
tree | 511822d41736a0cc4d40864906f59d3308293be9 /sc | |
parent | 5e0534ca76d3e666e7516ec7a9b05afdbfe4b056 (diff) |
lok: send error on access denied in image import
- when we paste HTML with references to external images
and host filter is configured then we have empty graphics
- inform client about that so we can show an error to the user
Change-Id: I7d584c256d8d004955c970056341ab42864d1dd3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160319
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/html/htmlpars.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index c2414d858802..d0d00a9ecc29 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -20,6 +20,7 @@ #include <memory> #include <sal/config.h> +#include <comphelper/lok.hxx> #include <comphelper/string.hxx> #include <scitems.hxx> @@ -37,6 +38,7 @@ #include <editeng/justifyitem.hxx> #include <sal/log.hxx> #include <sfx2/objsh.hxx> +#include <sfx2/lokhelper.hxx> #include <svl/numformat.hxx> #include <svl/intitem.hxx> #include <utility> @@ -47,6 +49,7 @@ #include <vcl/outdev.hxx> #include <vcl/svapp.hxx> +#include <tools/hostfilter.hxx> #include <tools/urlobj.hxx> #include <osl/diagnose.h> #include <o3tl/string_view.hxx> @@ -1318,6 +1321,13 @@ void ScHTMLLayoutParser::Image( HtmlImportInfo* pInfo ) return ; } + if (comphelper::LibreOfficeKit::isActive()) + { + INetURLObject aURL(pImage->aURL); + if (HostFilter::isForbidden(aURL.GetHost())) + SfxLokHelper::sendNetworkAccessError(); + } + sal_uInt16 nFormat; std::optional<Graphic> oGraphic(std::in_place); GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter(); |