diff --git a/server/functions.lua b/server/functions.lua index c472b68..7df5403 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -414,3 +414,15 @@ end function QBCore.Functions.Notify(source, text, type, length) TriggerClientEvent('QBCore:Notify', source, text, type, length) end + +--- SQL Pattern Matching +function QBCore.Functions.PrepForSQL(source,data,pattern) + local src = source + local player = QBCore.Functions.GetPlayer(src) + local result = string.match(data, pattern) + if not result or string.len(result) ~= string.len(data) then + TriggerEvent('qb-log:server:CreateLog', 'anticheat', 'SQL Injection Attempted', 'red', string.format('%s Attempted a SQL Exploit!', player.PlayerData.license)) + return false + end + return true +end \ No newline at end of file