Ticket #54728: 54728.diff
File 54728.diff, 2.7 KB (added by , 3 years ago) |
---|
-
src/wp-admin/user-edit.php
14 14 $user_id = (int) $user_id; 15 15 $current_user = wp_get_current_user(); 16 16 if ( ! defined( 'IS_PROFILE_PAGE' ) ) { 17 define( 'IS_PROFILE_PAGE', ( $user_id == $current_user->ID ) );17 define( 'IS_PROFILE_PAGE', ( $user_id === $current_user->ID ) ); 18 18 } 19 19 20 20 if ( ! $user_id && IS_PROFILE_PAGE ) { … … 93 93 */ 94 94 if ( is_multisite() 95 95 && ! current_user_can( 'manage_network_users' ) 96 && $user_id != $current_user->ID96 && $user_id !== $current_user->ID 97 97 && ! apply_filters( 'enable_edit_any_user_configuration', true ) 98 98 ) { 99 99 wp_die( __( 'Sorry, you are not allowed to edit this user.' ) ); … … 166 166 $errors = edit_user( $user_id ); 167 167 168 168 // 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 ) ) { 170 170 empty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id ); 171 171 } 172 172 … … 508 508 <th><label for="email"><?php _e( 'Email' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th> 509 509 <td><input type="email" name="email" id="email" aria-describedby="email-description" value="<?php echo esc_attr( $profileuser->user_email ); ?>" class="regular-text ltr" /> 510 510 <?php 511 if ( $profileuser->ID == $current_user->ID ) :511 if ( $profileuser->ID === $current_user->ID ) : 512 512 ?> 513 513 <p class="description" id="email-description"> 514 514 <?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>' ); ?> … … 517 517 endif; 518 518 519 519 $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 ) : 521 521 ?> 522 522 <div class="updated inline"> 523 523 <p> … … 862 862 $output = ''; 863 863 foreach ( $profileuser->caps as $cap => $value ) { 864 864 if ( ! $wp_roles->is_role( $cap ) ) { 865 if ( '' != $output ) {865 if ( '' !== $output ) { 866 866 $output .= ', '; 867 867 } 868 868