Commit 752e1804 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add more check about css imported from message

parent b5a4ec86
......@@ -40,6 +40,7 @@ void MessageViewerUtilsTest::shouldExcludeHeader_data()
QTest::newRow("REFRESH6") << QStringLiteral("<meta content=\"0;URL=http://www.kde.org\" http-equiv= \"REFRESH\"></head>") << true;
#endif
QTest::newRow("div1") << QStringLiteral("<div><p>ff</p></div></head>") << true;
QTest::newRow("body1") << QStringLiteral("<style>\nbody > div:nth-child(2) {\ndisplay: none !important;\n}\n</style>") << true;
}
void MessageViewerUtilsTest::shouldExcludeHeader()
......
......@@ -673,6 +673,10 @@ bool Util::excludeExtraHeader(const QString &s)
if (s.contains(divRef)) {
return true;
}
static QRegularExpression bodyRef(QStringLiteral("body.s*>.s*div"), QRegularExpression::CaseInsensitiveOption);
if (s.contains(bodyRef)) {
return true;
}
return false;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment