PaperMC/patches/server/0189-Fix-exploit-that-allowed-colored-signs-to-be-created.patch
Nassim Jahnke 08828fde02
More work
2022-07-27 21:49:24 +02:00

22 lines
1.6 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/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 7fb4e1cf4eb21dd19a581b082caf9825cdaa4ad9..78662c29e9771ddead43dc243fb5f7d802d6d40d 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3218,9 +3218,9 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
FilteredText filteredtext = (FilteredText) signText.get(i);
if (this.player.isTextFilteringEnabled()) {
- lines.add(net.kyori.adventure.text.Component.text(filteredtext.filteredOrEmpty())); // Paper - adventure
+ lines.add(SharedConstants.filterText(net.kyori.adventure.text.Component.text(filteredtext.filteredOrEmpty()))); // Paper - adventure
} else {
- lines.add(net.kyori.adventure.text.Component.text(filteredtext.raw())); // Paper - adventure
+ lines.add(net.kyori.adventure.text.Component.text(SharedConstants.filterText(filteredtext.raw()))); // Paper - adventure
}
}
SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.player.getBukkitEntity(), lines);