From b1ec326619f7b91e56252b992159fd00bbff2ba7 Mon Sep 17 00:00:00 2001 From: Gabor Kelemen Date: Wed, 12 Jan 2022 23:49:37 +0100 Subject: 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 Tested-by: Jenkins --- cui/source/dialogs/AdditionsDialog.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'cui/source') diff --git a/cui/source/dialogs/AdditionsDialog.cxx b/cui/source/dialogs/AdditionsDialog.cxx index 425de0230ff6..e1788a42b995 100644 --- a/cui/source/dialogs/AdditionsDialog.cxx +++ b/cui/source/dialogs/AdditionsDialog.cxx @@ -79,9 +79,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"); @@ -480,8 +478,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 -- cgit