Merge branch 'RED-9760-4.1-rules' into 'release/4.348.x'

RED-9760: Do not check blacklisted keywords in Strings

See merge request redactmanager/redaction-service!488
This commit is contained in:
Dominique Eifländer 2024-08-13 12:01:49 +02:00
commit 7396c04314

View File

@ -283,7 +283,9 @@ public class DroolsValidationService {
private DroolsBlacklistErrorMessage checkAndGetBlackListedMessages(SearchImplementation blacklistedKeywordSearchImplementation, String stringToCheck, int lineIndexStart) {
String sanitizedRuleText = StringUtils.deleteWhitespace(stringToCheck);
String nonWhitespaceRuleText = StringUtils.deleteWhitespace(stringToCheck);
String sanitizedRuleText= nonWhitespaceRuleText.replaceAll("\"(\\\\.|[^\"\\\\])*\"|'(\\\\.|[^'\\\\])*'" ,"");
List<SearchImplementation.MatchPosition> matches = blacklistedKeywordSearchImplementation.getMatches(sanitizedRuleText);
if (!matches.isEmpty()) {