Skip to content

Commit

Permalink
Pattern quote magic replace function arg
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarian2 committed Jan 4, 2024
1 parent ed33069 commit 348662d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/mimecast/robin/util/Magic.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public static String magicReplace(String magicString, Session session, boolean n
} else if ("replace".equals(magicFunction)) {
if (magicArgs != null && magicArgs.contains("|")) {
String[] replaceArgs = magicArgs.split("\\|", 2);
value = value.replaceAll(replaceArgs[0], replaceArgs[1]);
value = value.replaceAll(Pattern.quote(replaceArgs[0]), replaceArgs[1]);
} else {
log.warn("Magic replace function requires two arguments separated by | but got: {}", magicArgs);
}
Expand Down

0 comments on commit 348662d

Please sign in to comment.