force everything to lower case (#437)

This commit is contained in:
mayeaux 2021-12-06 19:22:09 +01:00 committed by GitHub
parent 1bfe9e2eda
commit 20ca590684
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,16 +48,21 @@ export default React.memo<Props>(function RecommendedContent(props: Props) {
title = title.toLowerCase();
}
let claimNameToCheckAgainst;
if (claim) {
claimNameToCheckAgainst = claim.name && claim.name.toLowerCase();
}
const checkDescriptionForBlacklistWords = AD_KEYWORD_BLOCKLIST_CHECK_DESCRIPTION === 'true';
let triggerBlacklist = false;
if (AD_KEYWORD_BLOCKLIST) {
const termsToCheck = AD_KEYWORD_BLOCKLIST.split(',');
const termsToCheck = AD_KEYWORD_BLOCKLIST.toLowerCase().split(',');
// eslint-disable-next-line no-unused-vars
if (title) {
for (const term of termsToCheck) {
if (claim && claim.name && claim.name.includes(term)) {
if (claimNameToCheckAgainst.includes(term)) {
triggerBlacklist = true;
}
if (title.includes(term)) {