diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-09-01 17:33:51 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-09-06 16:36:25 +0200 |
commit | 957ce53ebbd3a07d4776016b47776e1aa2925c44 (patch) | |
tree | 6875027d000184eaa7534965147c10b8169c0692 | |
parent | 965a713387422d75c3b16ac666f123ca6faa9570 (diff) |
Filter out unwanted command URIs
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139225
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
(cherry picked from commit 27d29f7df428885865a8e2313283839b20f2a34b)
Conflicts:
desktop/source/app/cmdlineargs.cxx
Change-Id: I0b7e5329af8cc053d14d5c60ec14fe7f364ef993
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139182
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-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 4d5a3bb78396..93d9e8742ba8 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -28,6 +28,7 @@ #include "cmdlineargs.hxx" #include <osl/thread.hxx> #include <tools/stream.hxx> +#include <tools/urlobj.hxx> #include <rtl/ustring.hxx> #include <rtl/process.h> #include <comphelper/lok.hxx> @@ -166,7 +167,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; } |