mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 17:48:01 +01:00
Restore the check for trueness on $user_id so we don't run the queries or create the objects. Fixes #11419 props Denis-de-Bernardy.
git-svn-id: http://svn.automattic.com/wordpress/trunk@12391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4bece20e85
commit
60dfe693d4
@ -506,7 +506,7 @@ function wp_allow_comment($commentdata) {
|
|||||||
|
|
||||||
do_action( 'check_comment_flood', $comment_author_IP, $comment_author_email, $comment_date_gmt );
|
do_action( 'check_comment_flood', $comment_author_IP, $comment_author_email, $comment_date_gmt );
|
||||||
|
|
||||||
if ( isset($user_id) ) {
|
if ( isset($user_id) && $user_id) {
|
||||||
$userdata = get_userdata($user_id);
|
$userdata = get_userdata($user_id);
|
||||||
$user = new WP_User($user_id);
|
$user = new WP_User($user_id);
|
||||||
$post_author = $wpdb->get_var($wpdb->prepare("SELECT post_author FROM $wpdb->posts WHERE ID = %d LIMIT 1", $comment_post_ID));
|
$post_author = $wpdb->get_var($wpdb->prepare("SELECT post_author FROM $wpdb->posts WHERE ID = %d LIMIT 1", $comment_post_ID));
|
||||||
|
Loading…
Reference in New Issue
Block a user