Escape placeholder pattern. fixes #4

This commit is contained in:
extendedclip 2018-03-26 17:32:18 -04:00
parent 4e1ff991c7
commit 2856889bbe
2 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.8.5</version>
<version>2.8.5-Dev-${BUILD_NUMBER}</version>
<name>PlaceholderAPI</name>
<description>An awesome placeholder provider!</description>
<url>http://extendedclip.com</url>

View File

@ -200,7 +200,7 @@ public class PlaceholderAPI {
if (hooks.containsKey(identifier)) {
String value = hooks.get(identifier).onPlaceholderRequest(player, params);
if (value != null) {
text = text.replaceAll(m.group(), Matcher.quoteReplacement(value));
text = text.replaceAll(Pattern.quote(m.group()), Matcher.quoteReplacement(value));
}
}
}
@ -250,7 +250,7 @@ public class PlaceholderAPI {
Relational rel = (Relational) hooks.get(identifier);
String value = rel.onPlaceholderRequest(one, two, params);
if (value != null) {
text = text.replaceAll(m.group(), Matcher.quoteReplacement(value));
text = text.replaceAll(Pattern.quote(m.group()), Matcher.quoteReplacement(value));
}
}
}