Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/29/2011 08:58:28 PM (12 years ago)
Author:
boonebgorges
Message:

Refactors URL canonicalization logic, moving it into the single bp_redirect_canonical() which is loaded from bp_core_load_template() instead of redirecting during the nav setup routine. See #1741. Combines all canonicalization into a single redirect. Fixes #3771. Ensures that query strings are preserved on redirects. Fixes #3777.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-members/bp-members-loader.php

    r5330 r5412  
    116116
    117117        if ( !bp_current_component() && bp_displayed_user_id() ) {
    118             /**
    119              * BuddyPress will attempt to resolve to the most specific URL possible,
    120              * to avoid search-engine-unfriendly content reduplication. Filter
    121              * bp_guarantee_unique_uris (and return false) to avoid this behavior
    122              */
    123             if ( apply_filters( 'bp_guarantee_unique_uris', true ) ) {
    124                 bp_core_redirect( bp_displayed_user_domain() . $bp->default_component );
    125             } else {
    126                 $bp->current_component = $bp->default_component;
    127             }
     118            $bp->current_component       = $bp->default_component;
     119           
     120            // Prepare for a redirect to the canonical URL
     121            $bp->redirect_stack['base_url']  = bp_displayed_user_domain();
     122            $bp->redirect_stack['component'] = $bp->default_component;
    128123        }
    129124    }
Note: See TracChangeset for help on using the changeset viewer.