cui/source/dialogs/AdditionsDialog.cxx |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit b1ec326619f7b91e56252b992159fd00bbff2ba7
Author:     Gabor Kelemen <kelem...@ubuntu.com>
AuthorDate: Wed Jan 12 23:49:37 2022 +0100
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Fri Jan 14 13:48:15 2022 +0100

    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 <sberg...@redhat.com>
    Tested-by: Jenkins

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

Reply via email to