From 5256ab4601cc0953c0d84720320d2cf3ddc3a9f7 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 13 Apr 2005 16:50:13 +0000 Subject: [PATCH] LIMIT 1 in the whitelist query. Props: Brian Dupuis git-svn-id: https://develop.svn.wordpress.org/trunk@2531 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/comment-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/comment-functions.php b/wp-includes/comment-functions.php index 300df69695..fb94031e30 100644 --- a/wp-includes/comment-functions.php +++ b/wp-includes/comment-functions.php @@ -657,7 +657,7 @@ function check_comment($author, $email, $url, $comment, $user_ip, $user_agent, $ else return false; } elseif( $author != '' && $email != '' ) { - $ok_to_comment = $wpdb->get_var("SELECT comment_approved FROM $wpdb->comments WHERE comment_author = '$author' AND comment_author_email = '$email' and comment_approved = '1' "); + $ok_to_comment = $wpdb->get_var("SELECT comment_approved FROM $wpdb->comments WHERE comment_author = '$author' AND comment_author_email = '$email' and comment_approved = '1' LIMIT 1"); if ( 1 == $ok_to_comment && false === strpos( $email, get_settings('moderation_keys')) ) return true; else