diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 36cb488be8..90982d3302 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -2768,7 +2768,6 @@ function wp_ajax_parse_media_shortcode() { * AJAX handler for destroying multiple open sessions for a user. * * @since 4.1.0 - * */ function wp_ajax_destroy_sessions() { @@ -2792,6 +2791,7 @@ function wp_ajax_destroy_sessions() { ) ); } + // 'token' is only set if the initiating user is viewing their own profile-editing screen. if ( isset( $_POST['token'] ) ) { $keep = wp_unslash( $_POST['token'] ); } else { @@ -2800,6 +2800,11 @@ function wp_ajax_destroy_sessions() { $sessions = WP_Session_Tokens::get_instance( $user->ID ); + /* + * If $keep is a string, then the current user is destroying all of their own sessions + * except the current one. If $keep is not a string, the current user is destroying all + * of another user's sessions with no exceptions. + */ if ( is_string( $keep ) ) { $sessions->destroy_others( $keep ); $message = __( 'You are now logged out everywhere else' ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 3a380b63ec..205a611a51 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.1-beta2-30594'; +$wp_version = '4.1-beta2-30595'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.