Ticket #2647: 2647.002.patch
File 2647.002.patch, 1.2 KB (added by , 13 years ago) |
---|
-
bp-core-catchuri.php
269 269 // Add .php to all options in $bp_path 270 270 foreach( (array) $bp_path as $template ) 271 271 $filtered_templates[] = "$template.php"; 272 272 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 277 273 if ( !$bp_path && !bp_is_blog_page() ) { 278 274 if ( is_user_logged_in() ) { 279 275 wp_redirect( $bp->root_domain ); 280 276 } 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'] ) ); 282 278 } 283 279 } 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 ); 284 284 } 285 285 add_action( 'wp', 'bp_core_catch_no_access' ); 286 286 287 287 /**