Don't require Qt5.12 just for QByteArray::compare

This commit is contained in:
Nicolas Werner 2020-01-16 20:36:44 +01:00
parent 853923916f
commit 719f1571b9
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}
}