From 8398e7118503d51da431ba850812ec76d1976b67 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Sat, 31 Jul 2021 22:07:29 +0200 Subject: Fix lack of percent encoding in User::fetchProfile Users with slashes in their ids do it at their own peril of course but to encode the id in the URL is a good thing in any case. Too bad it's pretty invisible and has to be dealt with case by case, instead of GTAD magically sticking QUrl::toPercentEncoding() where appropriate in the generated code. --- lib/user.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/user.cpp') diff --git a/lib/user.cpp b/lib/user.cpp index f0831733..4e369a4f 100644 --- a/lib/user.cpp +++ b/lib/user.cpp @@ -71,7 +71,9 @@ void User::Private::fetchProfile(const User* q) { defaultAvatar.emplace(Avatar {}); defaultName = ""; - auto* j = q->connection()->callApi(BackgroundRequest, id); + auto* j = + q->connection()->callApi(BackgroundRequest, + QUrl::toPercentEncoding(id)); // FIXME: accepting const User* and const_cast'ing it here is only // until we get a better User API in 0.7 QObject::connect(j, &BaseJob::success, q, -- cgit v1.2.3