Skip to:
Content

BuddyPress.org

Ticket #2604: bp-uri-chunk.diff

File bp-uri-chunk.diff, 1.1 KB (added by boonebgorges, 14 years ago)
  • bp-core/bp-core-catchuri.php

     
    5858                if ( empty( $bp_uri[$key] ) ) unset( $bp_uri[$key] );
    5959
    6060        if ( defined( 'BP_ENABLE_MULTIBLOG' ) || 1 != BP_ROOT_BLOG ) {
    61                 /* If we are running BuddyPress on any blog, not just a root blog, we need to first
    62                    shift off the blog name if we are running a subdirectory install of WPMU. */
    63                 if ( $current_blog->path != '/' )
    64                         array_shift( $bp_uri );
     61                /* Any subdirectory names must be removed from $bp_uri. This includes two cases: (1) when WP is installed in a subdirectory, and (2) when BP is running on secondary blog of a subdirectory multisite installation. */
     62                if ( $chunks = explode( '/', $current_blog->path ) ) {
     63                        foreach( $chunks as $key => $chunk ) {
     64                                $bkey = array_search( $chunk, $bp_uri );
     65                                if ( $bkey !== false )
     66                                        unset( $bp_uri[$bkey] );
     67                                $bp_uri = array_values( $bp_uri );
     68                        }
     69                }
    6570        }
    6671
    6772        /* Set the indexes, these are incresed by one if we are not on a VHOST install */