summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabor Kelemen <kelemeng@ubuntu.com>2022-01-12 23:49:37 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2022-01-14 13:48:15 +0100
commitb1ec326619f7b91e56252b992159fd00bbff2ba7 (patch)
treee2e58ac026b2ed115ed7d650b327ae9fa15e8f08
parent90df5b09188c66c3a7752934650570246dfc321d (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
-rw-r--r--cui/source/dialogs/AdditionsDialog.cxx10
1 files changed, 6 insertions, 4 deletions
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