Make WordPress Core


Ignore:
Timestamp:
07/29/2013 03:23:51 AM (11 years ago)
Author:
nacin
Message:

Remove "special" multisite spam check in the authentication API.

The spamming of a site no longer directly affects a user of said site.

Moves the spam check to the wp_authenticate filter. Networks in need
of enhanced spam-fighting should leverage this same technique.

Allow is_user_spammy() to accept a WP_User object.

props willnorris, brianhogg.
fixes #24771. see #19714.

File:
1 edited

Legend:

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

    r24155 r24848  
    17061706 * @uses get_user_by()
    17071707 *
    1708  * @param string $user_login Optional. Defaults to current user.
     1708 * @param string|WP_User $user Optional. Defaults to current user. WP_User object,
     1709 *  or user login name as a string.
    17091710 * @return bool
    17101711 */
    1711 function is_user_spammy( $user_login = null ) {
    1712     if ( $user_login )
    1713         $user = get_user_by( 'login', $user_login );
    1714     else
    1715         $user = wp_get_current_user();
     1712function is_user_spammy( $user = null ) {
     1713    if ( ! is_a( $user, 'WP_User' ) ) {
     1714        if ( $user )
     1715            $user = get_user_by( 'login', $user );
     1716        else
     1717            $user = wp_get_current_user();
     1718    }
    17161719
    17171720    return $user && isset( $user->spam ) && 1 == $user->spam;
Note: See TracChangeset for help on using the changeset viewer.