diff -r be944660c56a -r 3d72ae0968f4 wp/wp-admin/user-edit.php --- a/wp/wp-admin/user-edit.php Wed Sep 21 18:19:35 2022 +0200 +++ b/wp/wp-admin/user-edit.php Tue Sep 27 16:37:53 2022 +0200 @@ -13,8 +13,9 @@ $user_id = (int) $user_id; $current_user = wp_get_current_user(); + if ( ! defined( 'IS_PROFILE_PAGE' ) ) { - define( 'IS_PROFILE_PAGE', ( $user_id == $current_user->ID ) ); + define( 'IS_PROFILE_PAGE', ( $user_id === $current_user->ID ) ); } if ( ! $user_id && IS_PROFILE_PAGE ) { @@ -32,8 +33,10 @@ } if ( IS_PROFILE_PAGE ) { + // Used in the HTML title tag. $title = __( 'Profile' ); } else { + // Used in the HTML title tag. /* translators: %s: User's display name. */ $title = __( 'Edit User %s' ); } @@ -91,7 +94,7 @@ */ if ( is_multisite() && ! current_user_can( 'manage_network_users' ) - && $user_id != $current_user->ID + && $user_id !== $current_user->ID && ! apply_filters( 'enable_edit_any_user_configuration', true ) ) { wp_die( __( 'Sorry, you are not allowed to edit this user.' ) ); @@ -164,7 +167,10 @@ $errors = edit_user( $user_id ); // Grant or revoke super admin status if requested. - 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 ) ) { + 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 ) + ) { empty( $_POST['super_admin'] ) ? revoke_super_admin( $user_id ) : grant_super_admin( $user_id ); } @@ -179,701 +185,722 @@ // Intentional fall-through to display $errors. default: - $profileuser = get_user_to_edit( $user_id ); + $profile_user = get_user_to_edit( $user_id ); if ( ! current_user_can( 'edit_user', $user_id ) ) { wp_die( __( 'Sorry, you are not allowed to edit this user.' ) ); } - $title = sprintf( $title, $profileuser->display_name ); - $sessions = WP_Session_Tokens::get_instance( $profileuser->ID ); + $title = sprintf( $title, $profile_user->display_name ); + $sessions = WP_Session_Tokens::get_instance( $profile_user->ID ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?> - ID ) && current_user_can( 'manage_network_options' ) ) { ?> -
\n
", $errors->get_error_messages() ); ?>