From 719f1571b9fbc1016d9edf260577e39cbb31d226 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Thu, 16 Jan 2020 20:36:44 +0100 Subject: [PATCH] Don't require Qt5.12 just for QByteArray::compare --- src/Utils.cpp | 4 ++-- 1 file 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 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; } }