Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuergen Weigert <jnweiger@gmail.com>2021-01-31 00:23:35 +0300
committerJuergen Weigert <jnweiger@gmail.com>2021-01-31 00:34:50 +0300
commit9eb9a3ab0b9cd63fac74f96376345f3aff6275d9 (patch)
treed5dbb79bf18c84326e23e7c3a60a92b528f7158e
parentac7bd1a61ad3c87acc9aecfad6c2856a625cf5e7 (diff)
Suggest to use urlEncoding to protect '|', ':' and ',' of the protocol.fix8399
Several other characters are normally escaped, that are harmless in our case. QUrl handles that nicely with include and exclude lists.
-rw-r--r--src/gui/socketapi.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/socketapi.cpp b/src/gui/socketapi.cpp
index 822c44b1d..c62f21d84 100644
--- a/src/gui/socketapi.cpp
+++ b/src/gui/socketapi.cpp
@@ -1106,7 +1106,10 @@ void SocketApi::command_ASYNC_LIST_WIDGETS(const QSharedPointer<SocketApiJob> &j
for (auto &widget : allObjects(QApplication::allWidgets())) {
auto objectName = widget->objectName();
if (!objectName.isEmpty()) {
- response += objectName + ":" + widget->property("text").toString() + ", ";
+ // Apply urlencoding with escaped ',' and ':', so that the response can be safely split at these.
+ QString encObjectName = QUrl::toPercentEncoding(objectName, " =<>/&@\"", "|,:");
+ QString encTextProperty = QUrl::toPercentEncoding(widget->property("text").toString(), " =<>/&@\"", "|,:");
+ response += encObjectName + ":" + encTextProperty + ", ";
}
}
job->resolve(response);