Make WordPress Core


Ignore:
Timestamp:
07/01/2019 12:50:14 PM (6 years ago)
Author:
pento
Message:

Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-admin.

See #47632.

File:
1 edited

Legend:

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

    r45448 r45583  
    4545    }
    4646
    47     $pass1 = $pass2 = '';
     47    $pass1 = '';
     48    $pass2 = '';
    4849    if ( isset( $_POST['pass1'] ) ) {
    4950        $pass1 = $_POST['pass1'];
     
    202203    } elseif ( ! is_email( $user->user_email ) ) {
    203204        $errors->add( 'invalid_email', __( '<strong>ERROR</strong>: The email address isn&#8217;t correct.' ), array( 'form-field' => 'email' ) );
    204     } elseif ( ( $owner_id = email_exists( $user->user_email ) ) && ( ! $update || ( $owner_id != $user->ID ) ) ) {
    205         $errors->add( 'email_exists', __( '<strong>ERROR</strong>: This email is already registered, please choose another one.' ), array( 'form-field' => 'email' ) );
     205    } else {
     206        $owner_id = email_exists( $user->user_email );
     207        if ( $owner_id && ( ! $update || ( $owner_id != $user->ID ) ) ) {
     208            $errors->add( 'email_exists', __( '<strong>ERROR</strong>: This email is already registered, please choose another one.' ), array( 'form-field' => 'email' ) );
     209        }
    206210    }
    207211
Note: See TracChangeset for help on using the changeset viewer.