desktop/source/app/cmdlineargs.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
New commits: commit 06c2ac36aae6c65e5dd06ae711c6145985e6b5ae Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Thu Sep 1 17:33:51 2022 +0200 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Sep 2 13:08:31 2022 +0200 Filter out unwanted command URIs Change-Id: I0b7e5329af8cc053d14d5c60ec14fe7f364ef993 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139225 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> (cherry picked from commit 21229c2f45f96a8ee3060acb3296be77be3a9f1a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139183 Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index 05daddfda2f3..9f9251064fb2 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.subView(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; }