exact match for ip ban

git-svn-id: file:///home/shish/svn/shimmie2/trunk@450 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2007-08-08 05:18:54 +00:00
parent 5e041c1136
commit ad283be35f

View File

@ -121,7 +121,9 @@ class IPBan extends Extension {
public function get_ip_ban($ip) {
global $database;
// yes, this is "? LIKE var", because ? is the thing with matching tokens
return $database->db->GetRow("SELECT * FROM bans WHERE ? LIKE ip AND date < now() AND (end > now() OR isnull(end))", array($ip));
// actually, slow
// return $database->db->GetRow("SELECT * FROM bans WHERE ? LIKE ip AND date < now() AND (end > now() OR isnull(end))", array($ip));
return $database->db->GetRow("SELECT * FROM bans WHERE ip = ? AND date < now() AND (end > now() OR isnull(end))", array($ip));
}
public function add_ip_ban($ip, $reason, $end) {