diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-09-01 17:33:51 +0200 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2022-09-03 14:04:37 +0200 |
commit | 6f60a85d71f1e160bf48ca4d23cd9c99677961a2 (patch) | |
tree | 734f28726981f759c7a42e591e3862ebeee8e854 | |
parent | check IFrame "FrameURL" target (diff) | |
download | core-6f60a85d71f1e160bf48ca4d23cd9c99677961a2.tar.gz core-6f60a85d71f1e160bf48ca4d23cd9c99677961a2.zip |
Filter out unwanted command URIs
Change-Id: I0b7e5329af8cc053d14d5c60ec14fe7f364ef993
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139225
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Conflicts:
desktop/source/app/cmdlineargs.cxx
-rw-r--r-- | desktop/source/app/cmdlineargs.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index 8fe83f523c48..c00a3d6e42ad 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -29,6 +29,7 @@ #include <tools/stream.hxx> #include <vcl/svapp.hxx> #include <rtl/uri.hxx> +#include <tools/urlobj.hxx> #include <rtl/ustring.hxx> #include <rtl/process.h> #include <comphelper/lok.hxx> @@ -167,7 +168,14 @@ CommandLineEvent CheckOfficeURI(/* in,out */ OUString& arg, CommandLineEvent cur } if (nURIlen < 0) nURIlen = rest2.getLength(); - arg = rest2.copy(0, nURIlen); + auto const uri = rest2.copy(0, nURIlen); + if (INetURLObject(uri).GetProtocol() == INetProtocol::Macro) { + // Let the "Open" machinery process the full command URI (leading to failure, by intention, + // as the "Open" machinery does not know about those command URI schemes): + curEvt = CommandLineEvent::Open; + } else { + arg = uri; + } return curEvt; } |