aboutsummaryrefslogtreecommitdiff
path: root/runtime/src
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2024-04-16 01:05:14 +0900
committershedaniel <daniel@shedaniel.me>2024-04-16 01:05:27 +0900
commita231c65bea0a046a20010269bf61455b08060320 (patch)
tree2c0cefa8df5d55a579cb8ba4fdf12d25f3d586f1 /runtime/src
parent2af03ce523320bab4b4086f0661f80e466c14477 (diff)
downloadRoughlyEnoughItems-a231c65bea0a046a20010269bf61455b08060320.tar.gz
RoughlyEnoughItems-a231c65bea0a046a20010269bf61455b08060320.tar.bz2
RoughlyEnoughItems-a231c65bea0a046a20010269bf61455b08060320.zip
Fix crash searching illegal characters
Diffstat (limited to 'runtime/src')
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/text/TextTransformations.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/text/TextTransformations.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/text/TextTransformations.java
index d7a8d0a1c..8989b4fb3 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/text/TextTransformations.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/text/TextTransformations.java
@@ -36,6 +36,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.Locale;
import java.util.function.UnaryOperator;
+import java.util.regex.Pattern;
import static me.shedaniel.rei.impl.client.gui.config.options.ConfigUtils.literal;
@@ -106,7 +107,7 @@ public class TextTransformations {
if (string.toLowerCase(Locale.ROOT).equals(highlight.toLowerCase(Locale.ROOT))) {
return component.withStyle(styleOperator).withStyle(ChatFormatting.YELLOW);
}
- String[] parts = string.toLowerCase(Locale.ROOT).split(highlight.toLowerCase(Locale.ROOT));
+ String[] parts = string.toLowerCase(Locale.ROOT).split(Pattern.quote(highlight.toLowerCase(Locale.ROOT)));
if (string.toLowerCase(Locale.ROOT).endsWith(highlight.toLowerCase(Locale.ROOT))) {
// Append an empty string to the end
String[] newParts = new String[parts.length + 1];