Re :
http://ulyssesmod.net/bugs/view.php?id=208For the first time in probably months, I've looked at code not related to work (and enjoyed it, a little, gimme time. Work's killing me)
I see that ULib.addBan does no error checking for any syntax before it goes into a table and gets parsed into keyvalues.
Would the following solution fix the bug mentioned in 208?
function ULib.addBan( steamid, time, reason, name, admin )
local t = {}
t.time = os.time()
if time > 0 then
t.unban = ( ( time * 60 ) + t.time )
else
t.unban = 0
end
if reason then
t.reason = ULib.makePatternSafe( reason )
end
if name then
t.name = ULib.makePatternSafe( name )
end
if admin then
t.admin = "Console(Console)"
if admin:IsValid() then
t.admin = string.format( "%s(%s)", ULib.makePatternSafe( admin:Name() ), admin:SteamID() )
end
end
ULib.bans[ steamid ] = t
file.Write( ULib.BANS_FILE, ULib.makeKeyValues( ULib.bans ) )
end
OR, would the better method be to modify makeKeyValues to clean any strings?
Megiddo, we should probably get jay a mantis account until we decide on Flyspray or not.
He could at least assign himself anything he wants to dig into.