Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/27/2009 07:48:54 PM (15 years ago)
Author:
apeatling
Message:

Fixes #755 props chrisscott

File:
1 edited

Legend:

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

    r1714 r1715  
    3838            return false;
    3939    }
    40    
     40
    4141    if ( strpos( $_SERVER['REQUEST_URI'], 'wp-load.php' ) )
    4242        $path = bp_core_referrer();
     
    5050    $noget = substr( $path, 0, strpos( $path, '?' ) );
    5151    if ( $noget != '' ) $path = $noget;
    52    
     52
    5353    /* Fetch the current URI and explode each part seperated by '/' into an array */
    5454    $bp_uri = explode( "/", $path );
    55    
    56     if ( defined( 'BP_ENABLE_MULTIBLOG' ) ) {
     55
     56    /* Loop and remove empties */
     57    for ( $i = 0; $i <= count( $bp_uri ); $i++ )
     58        if ( empty( $bp_uri[$i] ) ) unset( $bp_uri[$i] );
     59
     60    if ( defined( 'BP_ENABLE_MULTIBLOG' ) || 1 != BP_ROOT_BLOG ) {
    5761        /* If we are running BuddyPress on any blog, not just a root blog, we need to first
    5862           shift off the blog name if we are running a subdirectory install of WPMU. */
     
    6064            array_shift( $bp_uri );
    6165    }
    62    
    63     /* Take empties off the end of complete URI */
    64     if ( empty( $bp_uri[count($bp_uri) - 1] ) )
    65         array_pop( $bp_uri );
    66 
    67     /* Take empties off the start of complete URI */
    68     if ( empty( $bp_uri[0] ) )
    69         array_shift( $bp_uri );
    70        
     66
    7167    /* Get total URI segment count */
    7268    $bp_uri_count = count( $bp_uri ) - 1;
     
    152148    $action_variables = array_merge( array(), $action_variables );
    153149
    154     //var_dump($current_component, $current_action, $action_variables);
     150    //var_dump($current_component, $current_action, $action_variables); die;
    155151}
    156152add_action( 'plugins_loaded', 'bp_core_set_uri_globals', 3 );
     
    175171
    176172    $bp_path = $pages;
    177    
     173
    178174    if ( !bp_is_blog_page() ) {
    179175        remove_action( 'template_redirect', 'redirect_canonical' );
Note: See TracChangeset for help on using the changeset viewer.