Paper/Spigot-Server-Patches/0209-Fix-exploit-that-allowed-colored-signs-to-be-created.patch

21 lines
1.3 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: 0x22 <0x22@futureclient.net>
Date: Thu, 26 Apr 2018 04:41:11 -0400
Subject: [PATCH] Fix exploit that allowed colored signs to be created
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index b92449c7035ebb330eb3aaa48e91a6d0b3873c5c..e72a519645e9383c989fc3ad8059c1c88c1b6382 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -2631,7 +2631,8 @@ public class PlayerConnection implements PacketListenerPlayIn {
String[] lines = new String[4];
for (int i = 0; i < list.size(); ++i) {
- lines[i] = EnumChatFormat.a(new ChatComponentText(EnumChatFormat.a((String) list.get(i))).getString());
+ // Paper TODO(Proximyst): Add obfhelper when 1.16.4 runs
+ lines[i] = SharedConstants.a(list.get(i)); // Paper - Replaced with anvil color stripping method to stop exploits that allow colored signs to be created.
}
SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.server.getPlayer(this.player), lines);
this.server.getPluginManager().callEvent(event);