Skip to:
Content

BuddyPress.org

Ticket #2491: bp_path_array.diff

File bp_path_array.diff, 1.1 KB (added by kunalb, 16 years ago)

Patch

  • bp-core-catchuri.php

     
    255255        if ( !$bp->displayed_user->id && $bp_unfiltered_uri[0] == BP_MEMBERS_SLUG && isset($bp_unfiltered_uri[1]) )
    256256                bp_core_redirect( $bp->root_domain );
    257257
     258        // Add .php to all options in $bp_path
     259        foreach( (array) $bp_path as $template ) $filtered_templates[] = "$template.php";
     260
    258261        // If the template file doesn't exist, redirect to the root domain.
    259         if ( !bp_is_blog_page() && !file_exists( apply_filters( 'bp_located_template', locate_template( array( $bp_path . '.php' ), false ), array( $bp_path . '.php' ) ) ) )
     262        if ( !bp_is_blog_page() && !file_exists( apply_filters( 'bp_located_template', locate_template( $filtered_templates, false ), $filtered_templates ) ) )
    260263                bp_core_redirect( $bp->root_domain );
    261264
    262265        if ( !$bp_path && !bp_is_blog_page() ) {
     
    283286                bp_core_load_template( apply_filters( 'bp_core_template_display_profile', 'members/single/home' ) );
    284287}
    285288
    286 ?>
    287  No newline at end of file
     289?>