Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

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

Fix more false positive

parent 698f6ae1
......@@ -138,7 +138,9 @@ void ScamDetectionWebEngineTest::scamtest_data()
QTest::newRow("scam-lowercase-2") << QStringLiteral(
"<a href=\"http://www.Kde.org/KDE/bla\">http://www.Kde.org/KDE/bla</a>")
<< false;
QTest::newRow("scam-lowercase-3") << QStringLiteral(
"<a href=\"http://code.qt.io/cgit/%7bnon-gerrit%7d/qt-labs/opencl.git\">http://code.qt.io/cgit/%7bnon-gerrit%7d/qt-labs/opencl.git</a>")
<< false;
}
void ScamDetectionWebEngineTest::scamtest()
......
......@@ -182,11 +182,15 @@ void ScamDetectionWebEngine::handleScanPage(const QVariant &result)
if (text != href) {
if (href != (text + QLatin1Char('/'))) {
if (href.toHtmlEscaped() != text) {
//qDebug() << " href: " << href << "text: " << text;
if (QString::fromUtf8(QUrl(text).toEncoded()) != href) {
d->mDetails += QLatin1String("<li>") + i18n(
"This email contains a link which reads as '%1' in the text, but actually points to '%2'. This is often the case in scam emails to mislead the recipient",
addWarningColor(text), addWarningColor(href)) + QLatin1String("</li>");
foundScam = true;
if (QUrl(href).toDisplayString() != text) {
d->mDetails += QLatin1String("<li>") + i18n(
"This email contains a link which reads as '%1' in the text, but actually points to '%2'. This is often the case in scam emails to mislead the recipient",
addWarningColor(text), addWarningColor(href)) + QLatin1String("</li>");
foundScam = true;
}
}
}
}
......
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