WordPress.org

Make WordPress Core

Ticket #33759: 33579.patch

File 33579.patch, 1.3 KB (added by smerriman, 5 years ago)
  • wp-includes/user-functions.php

     
    13301330         */
    13311331        if ( in_array( $user_login, apply_filters( 'illegal_user_logins', array() ) ) ) {
    13321332                return new WP_Error( 'illegal_user_login', __( 'Sorry, that username is not allowed.' ) );
    1333         }       
     1333        }
    13341334
    13351335        /*
    13361336         * If a nicename is provided, remove unsafe user characters before using it.
     
    16361636                 * @param array $userdata The updated user array.
    16371637                 *
    16381638                 */
    1639                 $send_password_change_email = apply_filters( 'send_password_change_email', true, $user, $userdata );
     1639                $send_password_change_email = apply_filters( 'send_password_change_email', ! current_user_can( 'manage_options' ), $user, $userdata );
    16401640        }
    16411641
    16421642        if ( isset( $userdata['user_email'] ) && $user['user_email'] !== $userdata['user_email'] ) {
     
    16521652                 * @param array $userdata The updated user array.
    16531653                 *
    16541654                 */
    1655                 $send_email_change_email = apply_filters( 'send_email_change_email', true, $user, $userdata );
     1655                $send_email_change_email = apply_filters( 'send_email_change_email', ! current_user_can( 'manage_options' ), $user, $userdata );
    16561656        }
    16571657
    16581658        wp_cache_delete( $user['user_email'], 'useremail' );