mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
* fixed CVE-2024-12276;
* reviewed using $wpdb and WPCS; * set minimum required version to 6.2 due to using %i for $wpdb->prepare;
This commit is contained in:
@@ -211,7 +211,15 @@ if ( ! class_exists( 'um\core\User_posts' ) ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
$count = $wpdb->get_var("SELECT COUNT(comment_ID) FROM " . $wpdb->comments. " WHERE user_id = " . $user_id . " AND comment_approved = '1'");
|
||||
$count = $wpdb->get_var(
|
||||
$wpdb->prepare(
|
||||
"SELECT COUNT(comment_ID)
|
||||
FROM {$wpdb->comments}
|
||||
WHERE user_id = %d AND
|
||||
comment_approved = '1'",
|
||||
$user_id
|
||||
)
|
||||
);
|
||||
|
||||
return $this->pretty_number_formatting( $count );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user