Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/29/2023 05:51:12 AM (19 months ago)
Author:
imath
Message:

Make sure BP_Component::parse_query() always run

Only running it when BP Rewrites are on is not the right way to go as some plugins might have been using the WP Rewrites API for a while and might have extended this method from their component's class.

Instead of only running this method if BP Rewrites are on, we're adding a URL parser check inside each component having a directory to figure out whether it's needed to set BP URI globals.

See #4954
Fixes #8908
Closes https://github.com/buddypress/buddypress/pull/109

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-template-loader.php

    r13468 r13492  
    566566    }
    567567
    568     // Set some needed URI globals.
    569     $bp                        = buddypress();
    570     $bp->unfiltered_uri        = explode( '/', $GLOBALS['wp']->request );
    571     $bp->unfiltered_uri_offset = 0;
     568    // Eventually Set some missing URI globals.
     569    $bp = buddypress();
     570
     571    if ( ! $bp->unfiltered_uri ) {
     572        $bp->unfiltered_uri        = explode( '/', $GLOBALS['wp']->request );
     573        $bp->unfiltered_uri_offset = 0;
     574    }
    572575
    573576    /**
Note: See TracChangeset for help on using the changeset viewer.