Skip to:
Content

BuddyPress.org

Changeset 5398


Ignore:
Timestamp:
11/27/2011 09:24:10 PM (15 years ago)
Author:
boonebgorges
Message:

When cross-referencing the bp_uri stack against paths in bp_core_set_uri_globals(), only remove matches that appear at the same index. Fixes #1726. Props sbrajesh for an early patch

File:
1 edited

Legend:

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

    r5372 r5398  
    113113                array_shift( $paths );
    114114
     115        // Reset indexes
     116        $bp_uri = array_values( $bp_uri );
     117        $paths  = array_values( $paths );
     118
    115119        // Unset URI indices if they intersect with the paths
    116120        foreach ( (array) $bp_uri as $key => $uri_chunk ) {
    117                 if ( in_array( $uri_chunk, $paths ) ) {
     121                if ( isset( $paths[$key] ) && $uri_chunk == $paths[$key] ) {
    118122                        unset( $bp_uri[$key] );
    119123                }
    120124        }
    121 
     125       
    122126        // Reset the keys by merging with an empty array
    123127        $bp_uri = array_merge( array(), $bp_uri );
Note: See TracChangeset for help on using the changeset viewer.