summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-01-16 20:36:44 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2020-01-16 20:36:44 +0100
commit719f1571b9fbc1016d9edf260577e39cbb31d226 (patch)
tree481d1dfecf468e21c0f36c9458c2f9d01ba6451e /src
parentFix deps (diff)
downloadnheko-719f1571b9fbc1016d9edf260577e39cbb31d226.tar.xz
Don't require Qt5.12 just for QByteArray::compare
Diffstat (limited to 'src')
-rw-r--r--src/Utils.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Utils.cpp b/src/Utils.cpp

index ddd066d7..1746883e 100644 --- a/src/Utils.cpp +++ b/src/Utils.cpp
@@ -317,7 +317,7 @@ utils::linkifyMessage(const QString &body) QString utils::escapeBlacklistedHtml(const QString &rawStr) { - static const std::vector<std::string_view> allowedTags = { + static const std::array allowedTags = { "font", "/font", "del", "/del", "h1", "/h1", "h2", "/h2", "h3", "/h3", "h4", "/h4", "h5", "/h5", "h6", "/h6", "blockquote", "/blockquote", "p", "/p", "a", "/a", "ul", "/ul", @@ -342,7 +342,7 @@ utils::escapeBlacklistedHtml(const QString &rawStr) auto mid = data.mid(pos + 1, endPos - pos - 1); for (const auto &tag : allowedTags) { // TODO: Check src and href attribute - if (mid.compare(tag.data(), Qt::CaseInsensitive) == 0) { + if (mid.toLower() == tag) { oneTagMatched = true; } }