diff options
author | Gabor Kelemen <kelemeng@ubuntu.com> | 2021-11-12 20:01:43 +0100 |
---|---|---|
committer | Gabor Kelemen <kelemeng@ubuntu.com> | 2021-11-23 13:57:41 +0100 |
commit | db0f2c29bf3a6ad5a08f8524ea0e65aa90792bb2 (patch) | |
tree | 2e3c9871a3a2d825b8e3eb945d98ef5c984c815f | |
parent | 6f435016092953478b5636fe9078866500fc7b90 (diff) |
tdf#144769 Properly encode file name in error dialog
Change-Id: Ie8f0b57c33fff787735b09ecf8308f86b56d8bb4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125121
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Reviewed-by: Gabor Kelemen <kelemeng@ubuntu.com>
-rw-r--r-- | sfx2/source/appl/openuriexternally.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sfx2/source/appl/openuriexternally.cxx b/sfx2/source/appl/openuriexternally.cxx index ebc5886ea5b8..7cc923aba241 100644 --- a/sfx2/source/appl/openuriexternally.cxx +++ b/sfx2/source/appl/openuriexternally.cxx @@ -18,6 +18,7 @@ #include <comphelper/processfactory.hxx> #include <rtl/ustring.hxx> #include <sfx2/sfxresid.hxx> +#include <tools/urlobj.hxx> #include <vcl/svapp.hxx> #include <vcl/weld.hxx> #include <openuriexternally.hxx> @@ -95,7 +96,7 @@ IMPL_LINK_NOARG(URITools, onOpenURI, Timer*, void) Application::CreateMessageDialog( mpDialogParent, VclMessageType::Warning, VclButtonsType::OkCancel, SfxResId(STR_DANGEROUS_TO_OPEN))); - eb->set_primary_text(eb->get_primary_text().replaceFirst("$(ARG1)", msURI)); + eb->set_primary_text(eb->get_primary_text().replaceFirst("$(ARG1)", INetURLObject::decode(msURI, INetURLObject::DecodeMechanism::Unambiguous))); if (eb->run() == RET_OK) { flags = 0; continue; @@ -104,7 +105,7 @@ IMPL_LINK_NOARG(URITools, onOpenURI, Timer*, void) std::unique_ptr<weld::MessageDialog> eb(Application::CreateMessageDialog(mpDialogParent, VclMessageType::Warning, VclButtonsType::Ok, SfxResId(STR_NO_ABS_URI_REF))); - eb->set_primary_text(eb->get_primary_text().replaceFirst("$(ARG1)", msURI)); + eb->set_primary_text(eb->get_primary_text().replaceFirst("$(ARG1)", INetURLObject::decode(msURI, INetURLObject::DecodeMechanism::Unambiguous))); eb->run(); } } catch (css::system::SystemShellExecuteException & e) { |