From ad283be35ffe96c30d22c26d57f2ec7560f2430d Mon Sep 17 00:00:00 2001 From: shish Date: Wed, 8 Aug 2007 05:18:54 +0000 Subject: [PATCH] exact match for ip ban git-svn-id: file:///home/shish/svn/shimmie2/trunk@450 7f39781d-f577-437e-ae19-be835c7a54ca --- ext/ipban/main.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/ipban/main.php b/ext/ipban/main.php index 245ef0fe..0ea463b1 100644 --- a/ext/ipban/main.php +++ b/ext/ipban/main.php @@ -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) {