mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2025-09-05 17:07:06 +02:00
Escape placeholder pattern. fixes #4
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user