mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2025-10-29 05:51:57 +01:00
Escape placeholder pattern. fixes #4
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
|||||||
<groupId>me.clip</groupId>
|
<groupId>me.clip</groupId>
|
||||||
<artifactId>placeholderapi</artifactId>
|
<artifactId>placeholderapi</artifactId>
|
||||||
|
|
||||||
<version>2.8.5</version>
|
<version>2.8.5-Dev-${BUILD_NUMBER}</version>
|
||||||
<name>PlaceholderAPI</name>
|
<name>PlaceholderAPI</name>
|
||||||
<description>An awesome placeholder provider!</description>
|
<description>An awesome placeholder provider!</description>
|
||||||
<url>http://extendedclip.com</url>
|
<url>http://extendedclip.com</url>
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ public class PlaceholderAPI {
|
|||||||
if (hooks.containsKey(identifier)) {
|
if (hooks.containsKey(identifier)) {
|
||||||
String value = hooks.get(identifier).onPlaceholderRequest(player, params);
|
String value = hooks.get(identifier).onPlaceholderRequest(player, params);
|
||||||
if (value != null) {
|
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);
|
Relational rel = (Relational) hooks.get(identifier);
|
||||||
String value = rel.onPlaceholderRequest(one, two, params);
|
String value = rel.onPlaceholderRequest(one, two, params);
|
||||||
if (value != null) {
|
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