Sanitize peer client names

PR #20788.
Closes #20010.
This commit is contained in:
Hanabishi 2024-05-11 20:46:11 +05:00 committed by GitHub
parent a19ef58400
commit 2c47f09d7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -198,7 +198,12 @@ QString PeerInfo::I2PAddress() const
QString PeerInfo::client() const
{
return QString::fromStdString(m_nativeInfo.client);
auto client = QString::fromStdString(m_nativeInfo.client).simplified();
// remove non-printable characters
erase_if(client, [](const QChar &c) { return !c.isPrint(); });
return client;
}
QString PeerInfo::peerIdClient() const