Make WordPress Core

Ticket #54728: 54728.diff

File 54728.diff, 2.7 KB (added by azouamauriac, 2 years ago)

src/wp-admin/user-edit.php

  • src/wp-admin/user-edit.php

     
    1414$user_id      = (int) $user_id;
    1515$current_user = wp_get_current_user();
    1616if ( ! defined( 'IS_PROFILE_PAGE' ) ) {
    17         define( 'IS_PROFILE_PAGE', ( $user_id == $current_user->ID ) );
     17        define( 'IS_PROFILE_PAGE', ( $user_id === $current_user->ID ) );
    1818}
    1919
    2020if ( ! $user_id && IS_PROFILE_PAGE ) {
     
    9393 */
    9494if ( is_multisite()
    9595        && ! current_user_can( 'manage_network_users' )
    96         && $user_id != $current_user->ID
     96        && $user_id !== $current_user->ID
    9797        && ! apply_filters( 'enable_edit_any_user_configuration', true )
    9898) {
    9999        wp_die( __( 'Sorry, you are not allowed to edit this user.' ) );
     
    166166                $errors = edit_user( $user_id );
    167167
    168168                // Grant or revoke super admin status if requested.
    169                 if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && ! isset( $super_admins ) && empty( $_POST['super_admin'] ) == is_super_admin( $user_id ) ) {
     169                if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && ! isset( $super_admins ) && empty( $_POST['super_admin'] ) === is_super_admin( $user_id ) ) {
    170170                        empty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id );
    171171                }
    172172
     
    508508                <th><label for="email"><?php _e( 'Email' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th>
    509509                <td><input type="email" name="email" id="email" aria-describedby="email-description" value="<?php echo esc_attr( $profileuser->user_email ); ?>" class="regular-text ltr" />
    510510                <?php
    511                 if ( $profileuser->ID == $current_user->ID ) :
     511                if ( $profileuser->ID === $current_user->ID ) :
    512512                        ?>
    513513                <p class="description" id="email-description">
    514514                        <?php _e( 'If you change this, we will send you an email at your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>' ); ?>
     
    517517                endif;
    518518
    519519                $new_email = get_user_meta( $current_user->ID, '_new_email', true );
    520                 if ( $new_email && $new_email['newemail'] != $current_user->user_email && $profileuser->ID == $current_user->ID ) :
     520                if ( $new_email && $new_email['newemail'] !== $current_user->user_email && $profileuser->ID === $current_user->ID ) :
    521521                        ?>
    522522                <div class="updated inline">
    523523                <p>
     
    862862                        $output = '';
    863863                        foreach ( $profileuser->caps as $cap => $value ) {
    864864                                if ( ! $wp_roles->is_role( $cap ) ) {
    865                                         if ( '' != $output ) {
     865                                        if ( '' !== $output ) {
    866866                                                $output .= ', ';
    867867                                        }
    868868