Fix urls in widgets being double encoded

See https://bugreports.qt.io/browse/QTBUG-110446
This commit is contained in:
Nicolas Werner 2023-12-04 20:32:29 +01:00
parent ed6abe989f
commit b4afeada58
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -3282,7 +3282,9 @@ TimelineModel::widgetLinks() const
// compat with some widgets, i.e. FOSDEM
url.replace("$theme", theme);
url = QUrl::toPercentEncoding(url, "/:@?#&=%");
// See https://bugreports.qt.io/browse/QTBUG-110446
// We want to make sure that urls are encoded, even if the source is untrustworthy.
url = QUrl(url).toEncoded();
list.push_back(
QLatin1String("<a href='%1'>%2</a>")