Commit e0fc73a2 authored by Laurent Montel's avatar Laurent Montel 😁

Don't signal as scam email when we have kmail:showAuditLog

parent 7b928f3b
......@@ -120,8 +120,10 @@ bool ScamDetection::scanFrame(const QWebElement &rootElement, QString &details)
foundScam = true;
} else if ((url.toString().count(QLatin1String("http://")) > 1) ||
(url.toString().count(QLatin1String("https://")) > 1)) { //5) more that 1 http in url.
details += QLatin1String("<li>") + i18n("This email contains a link (%1) which contains multiple http://. This is often the case in scam emails.", addWarningColor(url.toString())) + QLatin1String("</li>");
foundScam = true;
if (!url.toString().contains(QLatin1String("kmail:showAuditLog"))) {
details += QLatin1String("<li>") + i18n("This email contains a link (%1) which contains multiple http://. This is often the case in scam emails.", addWarningColor(url.toString())) + QLatin1String("</li>");
foundScam = true;
}
}
}
//Check shortUrl
......
......@@ -92,8 +92,10 @@ void ScamDetectionTest::testHref()
void ScamDetectionTest::testRedirectUrl()
{
const QString content = QLatin1String("<html><body><a href=\"http://www.google.fr/url?q=http://www.yahoo.com\">test</a></body></html>");
QString content = QLatin1String("<html><body><a href=\"http://www.google.fr/url?q=http://www.yahoo.com\">test</a></body></html>");
QCOMPARE(testHtml(content), true);
content = QLatin1String("<html><body><a href=\"kmail:showAuditLog?log=http://www.foo.com%3http://www.bla.com\">test</a></body></html>");
QCOMPARE(testHtml(content), false);
}
void ScamDetectionTest::testUrlWithNumericValue()
......
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