Paper/Spigot-Server-Patches/0210-Fix-exploit-that-allowed-colored-signs-to-be-created.patch
Mariell a0b8b886c8
Updated Upstream (CraftBukkit/Spigot) (#4318)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
d5a72960 SPIGOT-6063: ConsoleSender sending extra lines in Java 13+

Spigot Changes:
2740d5ae Rebuild patches
2020-09-12 15:57:21 -04:00

20 lines
1.3 KiB
Diff

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 4dc0b3a6054ef82ad675c30d30b6a7ad5acea400..c79db4e81883ce8635e91304b288f32e7bc2c763 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -2537,7 +2537,7 @@ public class PlayerConnection implements PacketListenerPlayIn {
String[] lines = new String[4];
for (int i = 0; i < astring.length; ++i) {
- lines[i] = EnumChatFormat.a(new ChatComponentText(EnumChatFormat.a(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);