Skip to:
Content

bbPress.org

Ticket #1835: 1835.diff

File 1835.diff, 1.6 KB (added by MZAWeb, 8 years ago)
  • includes/common/template-tags.php

     
    10841084 * Output hidden request URI field for user forms.
    10851085 *
    10861086 * The referer link is the current Request URI from the server super global. The
    1087  * input name is '_wp_http_referer', in case you wanted to check manually.
     1087 * input name is 'redirect_to', in case you wanted to check manually.
    10881088 *
    10891089 * @since bbPress (r2815)
    10901090 *
    1091  * @param string $url Pass a URL to redirect to
     1091 * @param string $redirect_to Pass a URL to redirect to
     1092 *
    10921093 * @uses wp_get_referer() To get the referer
    10931094 * @uses esc_attr() To escape the url
    1094  * @uses apply_filters() Calls 'bbp_redirect_to_field' with the referer field
    1095  *                        and url
     1095 * @uses apply_filters()      Calls 'bbp_redirect_to_field' with the referer field and url
    10961096 */
    10971097function bbp_redirect_to_field( $redirect_to = '' ) {
    10981098
    1099         // Rejig the $redirect_to
    1100         if ( !isset( $_SERVER['REDIRECT_URL'] ) || ( !$redirect_to == home_url( $_SERVER['REDIRECT_URL'] ) ) )
    1101                 $redirect_to = wp_get_referer();
    1102 
    11031099        // Make sure we are directing somewhere
    11041100        if ( empty( $redirect_to ) )
    1105                 $redirect_to = home_url( isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '' );
     1101                $redirect_to = home_url( isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : wp_get_referer() );
    11061102
    11071103        // Remove loggedout query arg if it's there
    11081104        $redirect_to    = (string) esc_attr( remove_query_arg( 'loggedout', $redirect_to ) );