mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Add some prophylactic int casts and quoting.
git-svn-id: https://develop.svn.wordpress.org/trunk@3740 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -60,7 +60,9 @@ function check_comment($author, $email, $url, $comment, $user_ip, $user_agent, $
|
||||
|
||||
function get_approved_comments($post_id) {
|
||||
global $wpdb;
|
||||
return $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $post_id AND comment_approved = '1' ORDER BY comment_date");
|
||||
|
||||
$post_id = (int) $post_id;
|
||||
return $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post_id' AND comment_approved = '1' ORDER BY comment_date");
|
||||
}
|
||||
|
||||
// Retrieves comment data given a comment ID or comment object.
|
||||
|
||||
Reference in New Issue
Block a user