From 35c7792aa2e4f09ab41823863055c6f84c1bc04b Mon Sep 17 00:00:00 2001 From: SquidDev Date: Sun, 4 Aug 2019 08:59:44 +0100 Subject: [PATCH] Limit the titles of printed pages Just enforce the same restrictions as we do for computer/disk labels. --- .../shared/peripheral/printer/PrinterPeripheral.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/dan200/computercraft/shared/peripheral/printer/PrinterPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/printer/PrinterPeripheral.java index e88202014..91ea62895 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/printer/PrinterPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/printer/PrinterPeripheral.java @@ -11,6 +11,7 @@ import dan200.computercraft.api.lua.LuaException; import dan200.computercraft.api.peripheral.IComputerAccess; import dan200.computercraft.api.peripheral.IPeripheral; import dan200.computercraft.core.terminal.Terminal; +import dan200.computercraft.shared.util.StringUtil; import javax.annotation.Nonnull; @@ -108,7 +109,7 @@ public class PrinterPeripheral implements IPeripheral // setPageTitle String title = optString( args, 0, "" ); getCurrentPage(); - m_printer.setPageTitle( title ); + m_printer.setPageTitle( StringUtil.normaliseLabel( title ) ); return null; } case 8: // getPaperLevel