SQL Injection Fix

This commit is contained in:
Selis
2023-08-13 21:50:03 +02:00
parent 39e4da338e
commit 95826dcb4b
2 changed files with 8 additions and 3 deletions
+2 -3
View File
@@ -46,11 +46,11 @@
var/cidquery = ""
if(address)
failedip = 0
ipquery = " OR ip = '[address]' "
ipquery = " OR ip = '[sanitizeSQL(address)]' "
if(computer_id)
failedcid = 0
cidquery = " OR computerid = '[computer_id]' "
cidquery = " OR computerid = '[sanitizeSQL(computer_id)]' "
var/DBQuery/query = dbcon.NewQuery("SELECT ckey, ip, computerid, a_ckey, reason, expiration_time, duration, bantime, bantype FROM erro_ban WHERE (ckey = '[ckeytext]' [ipquery] [cidquery]) AND (bantype = 'PERMABAN' OR (bantype = 'TEMPBAN' AND expiration_time > Now())) AND isnull(unbanned)")
@@ -81,4 +81,3 @@
message_admins("[key] has logged in with a blank ip in the ban check.")
return ..() //default pager ban stuff
#endif