Commit 4d543887 authored by Laurent Montel's avatar Laurent Montel 😁

Fix another false positive

parent 32252860
......@@ -127,6 +127,12 @@ void ScamDetectionWebEngineTest::scamtest_data()
QTest::newRow("scam-amp") << QStringLiteral(
"<a href=\"https://bugs.kde.org/enter_bug.cgi?format=guided&amp;product=gcompris\">https://bugs.kde.org/enter_bug.cgi?format=guided&amp;amp;product=gcompris</a></div>")
<< false;
QTest::newRow("scam-encoded-url1") << QStringLiteral(
"<a href=\"https://github.com/KDAB/KDStateMachineEditor.git|1.2\">https://github.com/KDAB/KDStateMachineEditor.git|1.2</a>")
<< false;
}
void ScamDetectionWebEngineTest::scamtest()
......
......@@ -182,10 +182,12 @@ void ScamDetectionWebEngine::handleScanPage(const QVariant &result)
if (text != href) {
if (href != (text + QLatin1Char('/'))) {
if (href.toHtmlEscaped() != 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;
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;
}
}
}
}
......
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