CHG: make ip matching for sqlite-black/whitelisted a strict match instead of a loose one

This commit is contained in:
ps 2014-06-28 16:19:48 +00:00
orang tua df573130df
melakukan 0b0c956dd5
1 mengubah file dengan 2 tambahan dan 2 penghapusan

Melihat File

@ -246,7 +246,7 @@ bool Database::whitelistedIP(string p_ip)
{
string sql="";
sql="SELECT ip FROM whitelisted_ips WHERE ip=SUBSTR(\""+p_ip+"\",0,LENGTH(ip)) LIMIT 1;";
sql="SELECT ip FROM whitelisted_ips WHERE ip=\""+p_ip+"\" LIMIT 1;";
if(countRows(sql)>0)
return true;
@ -306,7 +306,7 @@ bool Database::blacklistedIP(string p_ip)
{
string sql="";
sql="SELECT ip FROM blacklisted_ips WHERE ip=SUBSTR(\""+p_ip+"\",0,LENGTH(ip)) LIMIT 1;";
sql="SELECT ip FROM blacklisted_ips WHERE ip=\""+p_ip+"\" LIMIT 1;";
if(countRows(sql)>0)
return true;