Paper/Spigot-Server-Patches/0252-Fix-exploit-that-allowed-colored-signs-to-be-created.patch
2018-11-25 12:16:01 -05:00

23 lines
1.2 KiB
Diff

From 42e32c7a176b27311aae7d6ac8d3614133f17f48 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 aec39d8f7..e1a740cb9 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -2500,7 +2500,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
String[] lines = new String[4];
for (int i = 0; i < astring.length; ++i) {
- lines[i] = EnumChatFormat.b(new ChatComponentText(EnumChatFormat.b(astring[i])).getString());
+ lines[i] = SharedConstants.a(astring[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);
--
2.19.1