Skip to:
Content

bbPress.org

Changeset 6835


Ignore:
Timestamp:
07/05/2018 06:25:04 PM (7 years ago)
Author:
johnjamesjacoby
Message:

Login: Do not prematurely escape $redirect_to in bbp_logout_url().

This change fixes a bug causing the redirect URL to be escaped before it's encoded.

Props nevis2us. Fixes #3199.

File:
1 edited

Legend:

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

    r6827 r6835  
    14461446
    14471447    // Make sure we are directing somewhere
    1448     if ( empty( $redirect_to ) && !strstr( $url, 'redirect_to' ) ) {
     1448    if ( empty( $redirect_to ) && ! strstr( $url, 'redirect_to' ) ) {
    14491449
    14501450        // Rejig the $redirect_to
    14511451        if ( ! isset( $_SERVER['REDIRECT_URL'] ) || ( $redirect_to !== home_url( $_SERVER['REDIRECT_URL'] ) ) ) {
    1452             $redirect_to = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : '';
     1452            $redirect_to = isset( $_SERVER['HTTP_REFERER'] )
     1453                ? $_SERVER['HTTP_REFERER']
     1454                : '';
    14531455        }
    14541456
     1457        // Rebuild a basic redirect URL
    14551458        $redirect_to = bbp_get_url_scheme() . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    14561459
    14571460        // Sanitize $redirect_to and add it to full $url
    1458         $redirect_to = add_query_arg( array( 'loggedout'   => 'true'                    ), esc_url( $redirect_to ) );
    1459         $url         = add_query_arg( array( 'redirect_to' => urlencode( $redirect_to ) ), $url                    );
     1461        $redirect_to = add_query_arg( array( 'loggedout'   => 'true'                    ), $redirect_to );
     1462        $url         = add_query_arg( array( 'redirect_to' => urlencode( $redirect_to ) ), $url         );
    14601463    }
    14611464
Note: See TracChangeset for help on using the changeset viewer.