diff options
author | Juergen Weigert <jnweiger@gmail.com> | 2021-01-31 00:23:35 +0300 |
---|---|---|
committer | Juergen Weigert <jnweiger@gmail.com> | 2021-01-31 00:34:50 +0300 |
commit | 9eb9a3ab0b9cd63fac74f96376345f3aff6275d9 (patch) | |
tree | d5dbb79bf18c84326e23e7c3a60a92b528f7158e | |
parent | ac7bd1a61ad3c87acc9aecfad6c2856a625cf5e7 (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.cpp | 5 |
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); |