WordPress.org

Make WordPress Core

Changeset 23431


Ignore:
Timestamp:
02/15/2013 06:00:52 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Replace get_user_id_from_string() with get_user_by(). props ocean90, bananastalktome. fixes #23192. see #23190.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-functions.php

    r23416 r23431  
    17341734 *
    17351735 * @since MU
    1736  * @uses get_current_user_id()
    1737  * @uses get_user_id_from_string()
     1736 * @uses get_user_by()
    17381737 *
    17391738 * @param string $username
     
    17421741function is_user_spammy( $username = 0 ) {
    17431742    if ( $username == 0 ) {
    1744         $user_id = get_current_user_id();
     1743        $user = get_user_by( 'id', get_current_user_id() );
    17451744    } else {
    1746         $user_id = get_user_id_from_string( $username );
    1747     }
    1748     $u = get_userdata( $user_id );
    1749 
    1750     return ( isset( $u->spam ) && $u->spam == 1 );
     1745        $user = get_user_by( 'login', $username );
     1746    }
     1747
     1748    return ( isset( $user->spam ) && $user->spam == 1 );
    17511749}
    17521750
Note: See TracChangeset for help on using the changeset viewer.