Skip to:
Content

BuddyPress.org

Ticket #2647: 2647.002.patch

File 2647.002.patch, 1.2 KB (added by acustica, 13 years ago)
  • bp-core-catchuri.php

     
    269269        // Add .php to all options in $bp_path
    270270        foreach( (array) $bp_path as $template )
    271271                $filtered_templates[] = "$template.php";
    272272
    273         // If the template file doesn't exist, redirect to the root domain.
    274         if ( !bp_is_blog_page() && !file_exists( apply_filters( 'bp_located_template', locate_template( $filtered_templates, false ), $filtered_templates ) ) )
    275                 bp_core_redirect( $bp->root_domain );
    276 
    277273        if ( !$bp_path && !bp_is_blog_page() ) {
    278274                if ( is_user_logged_in() ) {
    279275                        wp_redirect( $bp->root_domain );
    280276                } else {
    281                         wp_redirect( site_url( 'wp-login.php?redirect_to=' . site_url() . $_SERVER['REQUEST_URI'] ) );
     277                        wp_redirect( wp_login_url( site_url() . $_SERVER['REQUEST_URI'] ) );
    282278                }
    283279        }
     280
     281        // If the template file doesn't exist, redirect to the root domain.
     282        if ( !bp_is_blog_page() && !file_exists( apply_filters( 'bp_located_template', locate_template( $filtered_templates, false ), $filtered_templates ) ) )
     283                bp_core_redirect( $bp->root_domain );
    284284}
    285285add_action( 'wp', 'bp_core_catch_no_access' );
    286286
    287287/**