Skip to content

Commit

Permalink
fix: When checking incoming and entered data for possible attacks, ca…
Browse files Browse the repository at this point in the history
…se is now ignored for keywords.
  • Loading branch information
jekutzsche committed Jun 30, 2022
1 parent cc3cc2e commit 71b9a60
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,16 @@ private static Optional<Range<Integer>> findAnyOfKeywordTuples(String str, Strin
private static Optional<Range<Integer>> findKeywordTuple(String input, String[] keywordTuple) {

for (var keyword : keywordTuple) {
if (indexOf(input, keyword) < 0) {
if (indexOfIgnoreCase(input, keyword) < 0) {
return Optional.empty();
}
}

var lastKeyword = keywordTuple[keywordTuple.length - 1];

return Optional
.of(Range.between(indexOf(input, keywordTuple[0]), indexOf(input, lastKeyword) + lastKeyword.length() - 1));
.of(Range.between(indexOfIgnoreCase(input, keywordTuple[0]),
indexOfIgnoreCase(input, lastKeyword) + lastKeyword.length() - 1));
}

private static Optional<Range<Integer>> findSymbolsAtStart(String input, String[] forbiddenSymbolsArray) {
Expand Down

0 comments on commit 71b9a60

Please sign in to comment.