Skip to:
Content

bbPress.org


Ignore:
Timestamp:
01/19/2011 08:01:37 AM (15 years ago)
Author:
johnjamesjacoby
Message:

Sanity checks on logout redirection global variables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-general-functions.php

    r2815 r2817  
    10291029 */
    10301030function bbp_logout_url( $url = '', $redirect_to = '' ) {
    1031     if ( !$redirect_to = home_url( $_SERVER['REDIRECT_URL'] ) )
    1032         $redirect_to = $_SERVER['HTTP_REFERER'];
     1031    if ( !isset( $_SERVER['REDIRECT_URL'] ) || !$redirect_to = home_url( $_SERVER['REDIRECT_URL'] ) )
     1032        $redirect_to = isset( $_SERVER['HTTP_REFERER'] ) ? $_SERVER['HTTP_REFERER'] : '';
    10331033
    10341034    if ( empty( $redirect_to ) )
    1035         $redirect_to = home_url( $_SERVER['REQUEST_URI'] );
     1035        $redirect_to = home_url( isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '' );
    10361036
    10371037    $url = add_query_arg( array( 'redirect_to' => esc_url( $redirect_to ) ), $url );
Note: See TracChangeset for help on using the changeset viewer.