Hello all, I have a little but big problem.. since I use in-built server SQL lite I have to check that accounts names and passwords aren't with any 'illegal' character since it could cause big problems aka SQL injection, so I made this little script
local invalid_Characters = {"$", ",", "'", "\\", "?", "%%", "~", "#", "&", "@", "-", "/", "`", "^", "{", "}", "+", "*", "%(", "%)", "!"}
function checkInvalidCharacters(str)
local state = false
for i, tmp in ipairs(invalid_Characters) do
outputChatBox("Checking " ..tmp)
if str:find(tmp) then
outputChatBox(tmp.. " found on str " ..str)
state = true
break
end
end
return state
end
The big problem is that it returns this
I tried str:find(tmp, 1, true) but no success.. looks like for loops can't handle invalid_Characters table? thanks