summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-12-06 14:41:19 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-12-08 17:01:38 +0100
commitb63aa51c55244ee67410201fa5e7c003427b1009 (patch)
tree6c1a4722e57addf1d48221c69ba1f15deb4f7dda
parent2ce9e78ec1cd745f626b071c024689d9b9daa18f (diff)
look at 'embedded' protocols too
Change-Id: Ie99f5f5a390639bdc69397c831e0a32594a5030c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177981 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit 59891cd3985469bc44dbd05c9fc704eeb07f0c78) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177987 Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
-rw-r--r--tools/source/fsys/urlobj.cxx21
1 files changed, 15 insertions, 6 deletions
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 07a27dd11007..845e99898a59 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -4884,12 +4884,21 @@ OUString INetURLObject::CutExtension()
bool INetURLObject::IsExoticProtocol() const
{
- return m_eScheme == INetProtocol::Slot ||
- m_eScheme == INetProtocol::Macro ||
- m_eScheme == INetProtocol::Uno ||
- m_eScheme == INetProtocol::VndSunStarExpand ||
- isSchemeEqualTo(u"vnd.sun.star.script") ||
- isSchemeEqualTo(u"service");
+ if (m_eScheme == INetProtocol::Slot ||
+ m_eScheme == INetProtocol::Macro ||
+ m_eScheme == INetProtocol::Uno ||
+ m_eScheme == INetProtocol::VndSunStarExpand ||
+ isSchemeEqualTo(u"vnd.sun.star.script") ||
+ isSchemeEqualTo(u"service"))
+ {
+ return true;
+ }
+ if (isSchemeEqualTo(u"vnd.sun.star.pkg") || isSchemeEqualTo(u"vnd.sun.star.zip"))
+ {
+ OUString sPayloadURL = GetURLPath(INetURLObject::DecodeMechanism::WithCharset);
+ return sPayloadURL.startsWith(u"//") && INetURLObject(sPayloadURL.subView(2)).IsExoticProtocol();
+ }
+ return false;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */