count() rather than RecordCount
This commit is contained in:
parent
8495a1ac89
commit
ce0d30e0db
@ -339,12 +339,11 @@ class CommentList extends SimpleExtension {
|
|||||||
$window = int_escape($config->get_int('comment_window'));
|
$window = int_escape($config->get_int('comment_window'));
|
||||||
$max = int_escape($config->get_int('comment_limit'));
|
$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)",
|
"AND posted > date_sub(now(), interval :window minute)",
|
||||||
Array("remote_ip"=>$_SERVER['REMOTE_ADDR'], "window"=>$window));
|
Array("remote_ip"=>$_SERVER['REMOTE_ADDR'], "window"=>$window));
|
||||||
$recent_comments = $result->RecordCount();
|
|
||||||
|
|
||||||
return ($recent_comments >= $max);
|
return (count($result) >= $max);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function hash_match() {
|
private function hash_match() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user