Skip to content

Commit

Permalink
Fix regression w/empty strings with KeywordReplacer (#5378)
Browse files Browse the repository at this point in the history
  • Loading branch information
JRoy authored Jun 2, 2023
1 parent fc3dabf commit 8d07c4b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ private void replaceKeywords(final CommandSource sender) {
String line = input.getLines().get(i);

// Skip processing b64 encoded items, they will not have keywords in them.
if (line.charAt(0) == '@') {
if (line.startsWith("@")) {
replaced.add(line);
continue;
}
Expand Down Expand Up @@ -383,7 +383,7 @@ private String replaceLine(String line, final String fullMatch, final String[] m

if (this.replaceSpacesWithUnderscores) {
// Don't replace spaces with underscores in command nor escape underscores.
if (line.charAt(0) != '/') {
if (line.startsWith("/")) {
replacer = replacer.replace("_", "\\_").replaceAll("\\s", "_");
}
}
Expand Down

0 comments on commit 8d07c4b

Please sign in to comment.