From 3e811c517152764ac1cdd5f3f4f5c13c48845e85 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 1 Mar 2013 18:01:16 +0000 Subject: [PATCH] Use distinct error code in wp_authenticate_username_password() when user is a spammer. props sirzooro. fixes #19445. git-svn-id: https://develop.svn.wordpress.org/trunk@23579 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/user.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-includes/user.php b/wp-includes/user.php index 56e6d082a5..ddca3703c0 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -87,18 +87,18 @@ function wp_authenticate_username_password($user, $username, $password) { $user = get_user_by('login', $username); if ( !$user ) - return new WP_Error('invalid_username', sprintf(__('ERROR: Invalid username. Lost your password?'), wp_lostpassword_url())); + return new WP_Error( 'invalid_username', sprintf( __( 'ERROR: Invalid username. Lost your password?' ), wp_lostpassword_url() ) ); if ( is_multisite() ) { // Is user marked as spam? - if ( 1 == $user->spam) - return new WP_Error('invalid_username', __('ERROR: Your account has been marked as a spammer.')); + if ( 1 == $user->spam ) + return new WP_Error( 'spammer_account', __( 'ERROR: Your account has been marked as a spammer.' ) ); // Is a user's blog marked as spam? - if ( !is_super_admin( $user->ID ) && isset($user->primary_blog) ) { + if ( !is_super_admin( $user->ID ) && isset( $user->primary_blog ) ) { $details = get_blog_details( $user->primary_blog ); if ( is_object( $details ) && $details->spam == 1 ) - return new WP_Error('blog_suspended', __('Site Suspended.')); + return new WP_Error( 'blog_suspended', __( 'Site Suspended.' ) ); } }