aboutsummaryrefslogtreecommitdiff
path: root/lib/util.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-05-13 21:43:54 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2019-05-13 21:44:26 +0900
commit1a034626bcbe064ebe0ada8cdfe1a47f2d82e477 (patch)
tree27e874e268a9703edd63c045cbf66c4c220f5994 /lib/util.cpp
parent3c253ed025246a34d849d14aac6feaee672d7e63 (diff)
downloadlibquotient-1a034626bcbe064ebe0ada8cdfe1a47f2d82e477.tar.gz
libquotient-1a034626bcbe064ebe0ada8cdfe1a47f2d82e477.zip
sanitized(): add object replacement character (0xfffc) to the blacklist
Diffstat (limited to 'lib/util.cpp')
-rw-r--r--lib/util.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/util.cpp b/lib/util.cpp
index 883db2ea..4e17d2f9 100644
--- a/lib/util.cpp
+++ b/lib/util.cpp
@@ -57,18 +57,19 @@ void QMatrixClient::linkifyUrls(QString& htmlEscapedText)
// NOTE: htmlEscapedText is already HTML-escaped! No literal <,>,&,"
htmlEscapedText.replace(EmailAddressRegExp,
- QStringLiteral(R"(<a href="mailto:\2">\1\2</a>)"));
+ QStringLiteral(R"(<a href="mailto:\2">\1\2</a>)"));
htmlEscapedText.replace(FullUrlRegExp,
- QStringLiteral(R"(<a href="\1">\1</a>)"));
+ QStringLiteral(R"(<a href="\1">\1</a>)"));
htmlEscapedText.replace(MxIdRegExp,
- QStringLiteral(R"(\1<a href="https://matrix.to/#/\2">\2</a>)"));
+ QStringLiteral(R"(\1<a href="https://matrix.to/#/\2">\2</a>)"));
}
QString QMatrixClient::sanitized(const QString& plainText)
{
auto text = plainText;
- text.remove(QChar(0x202e));
- text.remove(QChar(0x202d));
+ text.remove(QChar(0x202e)); // RLO
+ text.remove(QChar(0x202d)); // LRO
+ text.remove(QChar(0xfffc)); // Object replacement character
return text;
}