Make WordPress Core


Ignore:
Timestamp:
11/28/2014 03:47:43 AM (11 years ago)
Author:
DrewAPicture
Message:

Improve inline documentation in wp_ajax_destroy_sessions().

If the token is set ($keep is a string), this means the user is viewing their own profile-editing screen and destroying their own sessions (except the current one). If it isn't set ($keep is null), the user is editing another user's profile and destroying all of their sessions with no exceptions.

See #30264, #30469

File:
1 edited

Legend:

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

    r30591 r30595  
    27692769 *
    27702770 * @since 4.1.0
    2771  *
    27722771 */
    27732772function wp_ajax_destroy_sessions() {
     
    27932792    }
    27942793
     2794    // 'token' is only set if the initiating user is viewing their own profile-editing screen.
    27952795    if ( isset( $_POST['token'] ) ) {
    27962796        $keep = wp_unslash( $_POST['token'] );
     
    28012801    $sessions = WP_Session_Tokens::get_instance( $user->ID );
    28022802
     2803    /*
     2804     * If $keep is a string, then the current user is destroying all of their own sessions
     2805     * except the current one. If $keep is not a string, the current user is destroying all
     2806     * of another user's sessions with no exceptions.
     2807     */
    28032808    if ( is_string( $keep ) ) {
    28042809        $sessions->destroy_others( $keep );
Note: See TracChangeset for help on using the changeset viewer.