From ce0d30e0dbeffeebf184b56117bc191ba947d120 Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 13 Feb 2011 13:16:49 +0000 Subject: [PATCH] count() rather than RecordCount --- ext/comment/main.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ext/comment/main.php b/ext/comment/main.php index c9e47f01..a3baf0c5 100644 --- a/ext/comment/main.php +++ b/ext/comment/main.php @@ -339,12 +339,11 @@ class CommentList extends SimpleExtension { $window = int_escape($config->get_int('comment_window')); $max = int_escape($config->get_int('comment_limit')); - $result = $database->Execute("SELECT * FROM comments WHERE owner_ip = :remote_ip ". + $result = $database->get_all("SELECT * FROM comments WHERE owner_ip = :remote_ip ". "AND posted > date_sub(now(), interval :window minute)", Array("remote_ip"=>$_SERVER['REMOTE_ADDR'], "window"=>$window)); - $recent_comments = $result->RecordCount(); - return ($recent_comments >= $max); + return (count($result) >= $max); } private function hash_match() {