Browse Source

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

ps 6 years ago
parent
commit
0b0c956dd5
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/Database.cpp

+ 2 - 2
src/Database.cpp

@@ -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;