3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-28 00:50:13 +01:00

Merge pull request #2003 from connorhartley/chatitemrewriter-fix

Ensure normal keys that end with numbers don't get matched and replaced when replacing indexes
Dieser Commit ist enthalten in:
Nassim 2020-08-16 21:11:12 +02:00 committet von GitHub
Commit 83a49a686a
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -9,7 +9,7 @@ import us.myles.ViaVersion.api.data.UserConnection;
import java.util.regex.Pattern;
public class ChatItemRewriter {
private static final Pattern indexRemoval = Pattern.compile("\\d+:(?=([^\"\\\\]*(\\\\.|\"([^\"\\\\]*\\\\.)*[^\"\\\\]*\"))*[^\"]*$)");
private static final Pattern indexRemoval = Pattern.compile("(?<![\\w-.+])\\d+:(?=([^\"\\\\]*(\\\\.|\"([^\"\\\\]*\\\\.)*[^\"\\\\]*\"))*[^\"]*$)");
// Taken from https://stackoverflow.com/questions/6462578/alternative-to-regex-match-all-instances-not-inside-quotes
public static void toClient(JsonElement element, UserConnection user) {