Skip to content

Commit

Permalink
Properly escape definitions when sending through Regex
Browse files Browse the repository at this point in the history
Stupid regex, trying to be dynamic.
  • Loading branch information
mcmonkey4eva committed Dec 9, 2014
1 parent 8a10e17 commit b7b4cc2
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -58,7 +58,7 @@ public boolean execute(ScriptEntry scriptEntry) {
definition = "null";
}
dB.echoDebug(scriptEntry, "Filled definition %" + m.group(1) + "% with '" + definition + "'.");
m.appendReplacement(sb, definition.replace("$", "\\$"));
m.appendReplacement(sb, Matcher.quoteReplacement(definition));
}
m.appendTail(sb);
scriptEntry.setCommandName(sb.toString());
Expand Down Expand Up @@ -150,7 +150,7 @@ public boolean execute(ScriptEntry scriptEntry) {
definition = "null";
}
dB.echoDebug(scriptEntry, "Filled definition %" + m.group(1) + "% with '" + definition + "'.");
m.appendReplacement(sb, definition.replace("$", "\\$"));
m.appendReplacement(sb, Matcher.quoteReplacement(definition));
}
m.appendTail(sb);
arg = aH.Argument.valueOf(sb.toString());
Expand Down

0 comments on commit b7b4cc2

Please sign in to comment.