diff options
author | Gabor Kelemen <kelemeng@ubuntu.com> | 2022-01-12 23:49:37 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-01-14 16:38:47 +0100 |
commit | 9862ce925429e5a2f7f75f654f798f55b33e8bcf (patch) | |
tree | f18ee5fe67202ce539b6c31c50b6a766310544a6 /cui/source | |
parent | 0c8e6165fcdf060d7830f8d597686f39d19c2ffa (diff) |
tdf#146703 Rework previous fix to query extension metadata
to limit its error potential by encoding only the category string
Change-Id: Ia3d3bfa6981ec46b71b500980abda9ad7f606cd1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128361
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
(cherry picked from commit b1ec326619f7b91e56252b992159fd00bbff2ba7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128428
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/dialogs/AdditionsDialog.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cui/source/dialogs/AdditionsDialog.cxx b/cui/source/dialogs/AdditionsDialog.cxx index aa36bf49de87..c4247c29b516 100644 --- a/cui/source/dialogs/AdditionsDialog.cxx +++ b/cui/source/dialogs/AdditionsDialog.cxx @@ -80,9 +80,7 @@ std::string ucbGet(const OUString& rURL) { try { - OUString sEncodedUrl = INetURLObject::encode(rURL, INetURLObject::PART_FPATH, - INetURLObject::EncodeMechanism::All); - auto const s = utl::UcbStreamHelper::CreateStream(sEncodedUrl, StreamMode::STD_READ); + auto const s = utl::UcbStreamHelper::CreateStream(rURL, StreamMode::STD_READ); if (!s) { SAL_WARN("cui.dialogs", "CreateStream <" << rURL << "> failed"); @@ -460,8 +458,12 @@ AdditionsDialog::AdditionsDialog(weld::Window* pParent, const OUString& sAdditio this->set_title(titlePrefix); m_sTag = "allextensions"; // Means empty parameter } + + OUString sEncodedURLPart = INetURLObject::encode(m_sTag, INetURLObject::PART_PCHAR, + INetURLObject::EncodeMechanism::All); + //FIXME: Temporary URL - v0 is not using actual api - OUString rURL = "https://extensions.libreoffice.org/api/v0/" + m_sTag + ".json"; + OUString rURL = "https://extensions.libreoffice.org/api/v0/" + sEncodedURLPart + ".json"; m_sURL = rURL; m_xExtensionManager |