Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/13/2015 12:01:59 AM (10 years ago)
Author:
johnjamesjacoby
Message:

Users: Remove is_email() check from user query parsing.

This commit removes the ability to load a user profile via their email address. This feature (added in r2917) was a convenience mechanism to make finding a user within the forums with a known address easier, but times have changed and we now consider this to be a privacy concern by default.

Note: this will break backwards-compatibility for installations that may have used this unpublicized (and regrettably unwise) feature.

Fixes #2828. Hat-tip netweb. For 2.5.8 (2.5 branch)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.5/includes/core/template-functions.php

    r5262 r5814  
    160160
    161161        $content_dir = constant( 'WP_CONTENT_DIR' );
    162  
     162
    163163        // IIS (Windows) here
    164164        // Replace back slashes with forward slash
     
    228228
    229229        $content_dir = constant( 'WP_CONTENT_DIR' );
    230  
     230
    231231        // IIS (Windows) here
    232232        // Replace back slashes with forward slash
     
    458458 *
    459459 * @uses get_query_var() To get {@link WP_Query} query var
    460  * @uses is_email() To check if the string is an email
    461  * @uses get_user_by() To try to get the user by email and nicename
     460 * @uses get_user_by() To try to get the user by id or nicename
    462461 * @uses get_userdata() to get the user data
    463462 * @uses current_user_can() To check if the current user can edit the user
     
    498497        $the_user = false;
    499498
    500         // If using pretty permalinks, use the email or slug
     499        // If using pretty permalinks, always use slug
    501500        if ( get_option( 'permalink_structure' ) ) {
    502 
    503             // Email was passed
    504             if ( is_email( $bbp_user ) ) {
    505                 $the_user = get_user_by( 'email', $bbp_user );
    506 
    507             // Try nicename
    508             } else {
    509                 $the_user = get_user_by( 'slug', $bbp_user );
    510             }
    511         }
    512 
    513         // No user found by slug/email, so try the ID if it's numeric
    514         if ( empty( $the_user ) && is_numeric( $bbp_user ) ) {
     501            $the_user = get_user_by( 'slug', $bbp_user );
     502
     503        // If not using pretty permalinks, always use numeric ID
     504        } elseif ( is_numeric( $bbp_user ) ) {
    515505            $the_user = get_user_by( 'id', $bbp_user );
    516506        }
Note: See TracChangeset for help on using the changeset viewer.