Decode the href from the XML payload
authorKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 7 Jul 2020 14:50:31 +0000 (16:50 +0200)
committerKevin Ottens (Rebase PR Action) <er-vin@users.noreply.github.com>
Tue, 7 Jul 2020 15:51:24 +0000 (15:51 +0000)
The XML we get as reply has href entities properly percent encoded.
Since we didn't go through QUrl next we didn't get a properly decoded
version. Make sure we decode it before storage.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
src/libsync/clientsideencryptionjobs.cpp

index 1f8a65a7c15776c2faaa618c4ddd31483371e853..7362ba45997e1453700313a96cce69767ce0106b 100644 (file)
@@ -86,7 +86,7 @@ bool GetFolderEncryptStatusJob::finished()
             if (type == QXmlStreamReader::StartElement) {
                 if (reader.name() == QLatin1String("href")) {
                     // If the current file is not a folder, ignore it.
-                    currFile = reader.readElementText(QXmlStreamReader::SkipChildElements);
+                    currFile = QUrl::fromPercentEncoding(reader.readElementText(QXmlStreamReader::SkipChildElements).toUtf8());
                     currFile.remove(base + QLatin1String("/remote.php/webdav/"));
                     if (!currFile.endsWith('/'))
                         currFile.clear();