Fix exploit (#72)

* exploit fix

* Removed useless gsub
This commit is contained in:
Dmytro 2022-08-04 03:18:07 +03:00 committed by GitHub
parent 0b162c3a7e
commit 4e3d543a8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -192,11 +192,8 @@ function ULib.addBan( steamid, time, reason, name, admin )
ULib.kick( ply, longReason, nil, true)
end
-- Remove all semicolons from the reason to prevent command injection
shortReason = string.gsub(shortReason, ";", "")
-- This redundant kick is to ensure they're kicked -- even if they're joining
game.ConsoleCommand( string.format( "kickid %s %s\n", steamid, shortReason or "" ) )
RunConsoleCommand("kickid", steamid, shortReason or "")
writeBan( t )
hook.Call( ULib.HOOK_USER_BANNED, _, steamid, t )
@ -218,7 +215,8 @@ end
v2.10 - Initial
]]
function ULib.unban( steamid, admin )
game.ConsoleCommand( "removeid " .. steamid .. ";writeid\n" ) -- Remove from srcds in case it was stored there
RunConsoleCommand("removeid", steamid) -- Remove from srcds in case it was stored there
RunConsoleCommand("writeid") -- Saving
--ULib banlist
ULib.bans[ steamid ] = nil