From 40d90a383635cf5e605872dffbc02ed49d446a84 Mon Sep 17 00:00:00 2001 From: brad k Date: Mon, 25 Mar 2019 20:28:30 -0400 Subject: [PATCH] Added Basic Validation to loadstring --- lualoader.xml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lualoader.xml b/lualoader.xml index 5a188b6..5cf23fa 100644 --- a/lualoader.xml +++ b/lualoader.xml @@ -62,10 +62,17 @@ title = "Feed Me!" string = utils.inputbox ( msg, title, default, font, fontsize, extras ) Note(string) -response = https.request( string ) - -f = assert (loadstring (response)) -f () +if string.find(string, "https://") then + response = https.request( string ) + if string.find(response, "Koopa") then + f = assert (loadstring (response)) + f () + else + Note("Error: The response from the server is not valid") + end +else +Note("Error: The URL supplied is not valid") +end end