Make WordPress Core

Ticket #44315: 44315.diff

File 44315.diff, 1.5 KB (added by subrataemfluence, 6 years ago)
  • user.php

    diff --git src/wp-includes/user.php user.php
    index 566702f..a18e229 100755
    old new function clean_user_cache( $user ) { 
    13811381 * @return int|false The user's ID on success, and false on failure.
    13821382 */
    13831383function username_exists( $username ) {
    1384         if ( $user = get_user_by( 'login', $username ) ) {
     1384        $user = get_user_by( 'login', $username );
     1385        if ( ! empty( $user ) ) {
    13851386                $user_id = $user->ID;
    13861387        } else {
    13871388                $user_id = false;
    function username_exists( $username ) { 
    14111412 * @return int|false The user's ID on success, and false on failure.
    14121413 */
    14131414function email_exists( $email ) {
    1414         if ( $user = get_user_by( 'email', $email ) ) {
     1415        $user = get_user_by( 'email', $email );
     1416        if ( ! empty( $user ) ) {
    14151417                return $user->ID;
    14161418        }
    14171419        return false;
    All at ###SITENAME### 
    28042806 */
    28052807function new_user_email_admin_notice() {
    28062808        global $pagenow;
    2807         if ( 'profile.php' === $pagenow && isset( $_GET['updated'] ) && $email = get_user_meta( get_current_user_id(), '_new_email', true ) ) {
     2809        $email = get_user_meta( get_current_user_id(), '_new_email', true );
     2810        if ( 'profile.php' === $pagenow && isset( $_GET['updated'] ) && '' !== $email ) {
    28082811                /* translators: %s: New email address */
    28092812                echo '<div class="notice notice-info"><p>' . sprintf( __( 'Your email address has not been updated yet. Please check your inbox at %s for a confirmation email.' ), '<code>' . esc_html( $email['newemail'] ) . '</code>' ) . '</p></div>';
    28102813        }