Skip to:
Content

BuddyPress.org

Changeset 6440


Ignore:
Timestamp:
10/22/2012 07:24:55 AM (12 years ago)
Author:
johnjamesjacoby
Message:

Cleane up bp_core_redirect() to use wp_safe_redirect() instead of wp_redirect().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-functions.php

    r6355 r6440  
    573573 *
    574574 * @package BuddyPress Core
    575  * @global BuddyPress $bp Makes sure that there are no conflicts with
    576  *                         status_header() called in bp_core_do_catch_uri()
    577  * @uses wp_redirect()
     575 * @uses wp_safe_redirect()
    578576 */
    579577function bp_core_redirect( $location, $status = 302 ) {
    580     global $bp;
    581 
    582     // On some setups, passing the value of wp_get_referer() may result in an empty value for
    583     // $location, which results in an error. Ensure that we have a valid URL.
    584     if ( empty( $location ) ) {
     578
     579    // On some setups, passing the value of wp_get_referer() may result in an
     580    // empty value for $location, which results in an error. Ensure that we
     581    // have a valid URL.
     582    if ( empty( $location ) )
    585583        $location = bp_get_root_domain();
    586     }
    587 
    588     // Make sure we don't call status_header() in bp_core_do_catch_uri()
    589     // as this conflicts with wp_redirect()
    590     $bp->no_status_set = true;
    591 
    592     wp_redirect( $location, $status );
     584
     585    // Make sure we don't call status_header() in bp_core_do_catch_uri() as this
     586    // conflicts with wp_redirect() and wp_safe_redirect().
     587    buddypress()->no_status_set = true;
     588
     589    wp_safe_redirect( $location, $status );
    593590    die;
    594591}
Note: See TracChangeset for help on using the changeset viewer.