From 20ca590684a91273f475ba4f7b0cdd1d999b4d11 Mon Sep 17 00:00:00 2001 From: mayeaux Date: Mon, 6 Dec 2021 19:22:09 +0100 Subject: [PATCH] force everything to lower case (#437) --- ui/component/recommendedContent/view.jsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ui/component/recommendedContent/view.jsx b/ui/component/recommendedContent/view.jsx index 220321e23..a8fd8160b 100644 --- a/ui/component/recommendedContent/view.jsx +++ b/ui/component/recommendedContent/view.jsx @@ -48,16 +48,21 @@ export default React.memo(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)) {