Skip to content

Commit

Permalink
Fix homoglyph filtering (CONTAINS filters)
Browse files Browse the repository at this point in the history
Co-authored-by: MessyEllie <[email protected]>
  • Loading branch information
gdude2002 and MessyEllie committed May 15, 2023
1 parent 8f870f0 commit e2233e0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ class FilterExtension : Extension() {
}

suspend fun FilterEntry.matches(content: String): Boolean = when (matchType) {
MatchType.CONTAINS -> homoglyphs.search(match.lowercase()).size > 0
MatchType.CONTAINS -> homoglyphs.search(content, match.lowercase()).size > 0
MatchType.EXACT -> content.equals(match, ignoreCase = true)
MatchType.REGEX -> match.toRegex(RegexOption.IGNORE_CASE).matches(content)
MatchType.REGEX_CONTAINS -> content.contains(match.toRegex(RegexOption.IGNORE_CASE))
Expand Down

0 comments on commit e2233e0

Please sign in to comment.