Skip to:
Content

bbPress.org

Changeset 6454


Ignore:
Timestamp:
06/01/2017 09:24:09 PM (4 years ago)
Author:
johnjamesjacoby
Message:

Moderators: Trim usernames after they're exploded.

Resolves an issue where spaces in the comma separated usernames field would result in skipping that user.

Fixes #3097.

Location:
trunk/src/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/forums/functions.php

    r6438 r6454  
    714714
    715715            // Escape tag input
    716             $users = sanitize_text_field( $_POST['bbp_moderators'] );
    717 
    718             // Explode by comma
    719             $users = strstr( $users, ',' )
    720                 ? explode( ',', $users )
    721                 : (array) $users;
    722 
     716            $users    = sanitize_text_field( $_POST['bbp_moderators'] );
    723717            $user_ids = bbp_get_user_ids_from_nicenames( $users );
    724718
  • trunk/src/includes/users/functions.php

    r6438 r6454  
    625625            : (array) $user_nicenames;
    626626
     627        // Trim spaces off of nicenames
     628        $user_nicenames = array_map( 'trim', $user_nicenames );
     629
    627630        // Get users
    628631        $users = get_users( array(
Note: See TracChangeset for help on using the changeset viewer.