WordPress.org

Make WordPress Core

Changeset 23579


Ignore:
Timestamp:
03/01/13 18:01:16 (2 years ago)
Author:
SergeyBiryukov
Message:

Use distinct error code in wp_authenticate_username_password() when user is a spammer. props sirzooro. fixes #19445.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/user.php

    r23554 r23579  
    8888 
    8989    if ( !$user ) 
    90         return new WP_Error('invalid_username', sprintf(__('<strong>ERROR</strong>: Invalid username. <a href="%s" title="Password Lost and Found">Lost your password</a>?'), wp_lostpassword_url())); 
     90        return new WP_Error( 'invalid_username', sprintf( __( '<strong>ERROR</strong>: Invalid username. <a href="%s" title="Password Lost and Found">Lost your password</a>?' ), wp_lostpassword_url() ) ); 
    9191 
    9292    if ( is_multisite() ) { 
    9393        // Is user marked as spam? 
    94         if ( 1 == $user->spam) 
    95             return new WP_Error('invalid_username', __('<strong>ERROR</strong>: Your account has been marked as a spammer.')); 
     94        if ( 1 == $user->spam ) 
     95            return new WP_Error( 'spammer_account', __( '<strong>ERROR</strong>: Your account has been marked as a spammer.' ) ); 
    9696 
    9797        // Is a user's blog marked as spam? 
    98         if ( !is_super_admin( $user->ID ) && isset($user->primary_blog) ) { 
     98        if ( !is_super_admin( $user->ID ) && isset( $user->primary_blog ) ) { 
    9999            $details = get_blog_details( $user->primary_blog ); 
    100100            if ( is_object( $details ) && $details->spam == 1 ) 
    101                 return new WP_Error('blog_suspended', __('Site Suspended.')); 
     101                return new WP_Error( 'blog_suspended', __( 'Site Suspended.' ) ); 
    102102        } 
    103103    } 
Note: See TracChangeset for help on using the changeset viewer.