From e153839a9824d858347a91beb20b6906d061ead7 Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Fri, 26 May 2023 10:19:42 +0100 Subject: [PATCH] Detect playing HTML files in speaker Goes someway towards preventing people playing YouTube or non-raw GitHub files. --- .../data/computercraft/lua/rom/programs/fun/speaker.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/core/src/main/resources/data/computercraft/lua/rom/programs/fun/speaker.lua b/projects/core/src/main/resources/data/computercraft/lua/rom/programs/fun/speaker.lua index af55423f3..de6b03e64 100644 --- a/projects/core/src/main/resources/data/computercraft/lua/rom/programs/fun/speaker.lua +++ b/projects/core/src/main/resources/data/computercraft/lua/rom/programs/fun/speaker.lua @@ -31,7 +31,7 @@ local function pcm_decoder(chunk) end local function report_invalid_format(format) - printError(("The speaker cannot play %s files."):format(format)) + printError(("speaker cannot play %s files."):format(format)) local pp = require "cc.pretty" pp.print("Run '" .. pp.text("help speaker", colours.lightGrey) .. "' for information on supported formats.") end @@ -107,6 +107,7 @@ elseif cmd == "play" then elseif start == "OggS" then return report_invalid_format("Ogg") elseif start == "fLaC" then return report_invalid_format("FLAC") elseif start:sub(1, 3) == "ID3" then return report_invalid_format("MP3") + elseif start == "