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 8cd53136 authored by Laurent Montel's avatar Laurent Montel 😁

Fix check potential phising

parent dcc6574a
......@@ -58,6 +58,10 @@ void PotentialPhishingEmailJobTest::shouldReturnPotentialPhishingEmails_data()
QTest::newRow("notsamecase") << (QStringList() << QLatin1String("\"Foo@kde.org\" <foo@kde.org>")) << QStringList() << false;
QTest::newRow("notsamecaseaddress") << (QStringList() << QLatin1String("\"Foo@kde.org\" <FOO@kde.ORG>")) << QStringList() << false;
QTest::newRow("emailinparenthese") << (QStringList() << QLatin1String("\"bla (Foo@kde.org)\" <FOO@kde.ORG>")) << QStringList() << false;
QTest::newRow("notemailinparenthese") << (QStringList() << QLatin1String("\"bla (bli@kde.org)\" <FOO@kde.ORG>")) << QStringList() << true;
QTest::newRow("erroremailinparenthese") << (QStringList() << QLatin1String("\"bla Foo@kde.org\" <FOO@kde.ORG>")) << QStringList() << true;
}
void PotentialPhishingEmailJobTest::shouldReturnPotentialPhishingEmails()
......
......@@ -64,7 +64,10 @@ bool PotentialPhishingEmailJob::start()
tname = tname.mid(1,tname.length()-2);
}
if (temail.toLower() != tname.toLower()) {
mPotentialPhisingEmails.append(addr);
QString str = QString::fromLatin1("(%1)").arg(temail.toLower());
if (!tname.toLower().contains(str)) {
mPotentialPhisingEmails.append(addr);
}
}
}
}
......
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