Changeset 5818
- Timestamp:
- 02/21/2012 02:22:22 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-catchuri.php
r5817 r5818 76 76 // If running off blog other than root, any subdirectory names must be 77 77 // removed from $bp_uri. This includes two cases: 78 // 78 // 79 79 // 1. when WP is installed in a subdirectory, 80 80 // 2. when BP is running on secondary blog of a subdirectory … … 123 123 } 124 124 } 125 125 126 126 // Reset the keys by merging with an empty array 127 127 $bp_uri = array_merge( array(), $bp_uri ); … … 317 317 /** 318 318 * Are root profiles enabled and allowed 319 * 319 * 320 320 * @since BuddyPress (1.6) 321 321 * @return bool True if yes, false if no 322 322 */ 323 323 function bp_core_enable_root_profiles() { 324 324 325 325 $retval = false; 326 326 327 327 if ( defined( 'BP_ENABLE_ROOT_PROFILES' ) && ( true == BP_ENABLE_ROOT_PROFILES ) ) 328 328 $retval = true; 329 329 330 330 return apply_filters( 'bp_core_enable_root_profiles', $retval ); 331 331 } … … 355 355 } 356 356 } 357 357 358 358 // Set the root object as the current wp_query-ied item 359 359 $object_id = 0; … … 370 370 $post = $wp_query->queried_object; 371 371 } 372 372 373 373 // Define local variables 374 374 $located_template = false; … … 391 391 392 392 load_template( apply_filters( 'bp_load_template', $located_template ) ); 393 393 394 394 do_action( 'bp_core_post_load_template', $located_template ); 395 395 } … … 442 442 function bp_core_no_access( $args = '' ) { 443 443 444 // Build the redirect URL 444 // Build the redirect URL 445 445 $redirect_url = is_ssl() ? 'https://' : 'http://'; 446 446 $redirect_url .= $_SERVER['HTTP_HOST']; … … 530 530 function bp_redirect_canonical() { 531 531 global $bp; 532 532 533 533 if ( !bp_is_blog_page() && apply_filters( 'bp_do_redirect_canonical', true ) ) { 534 534 // If this is a POST request, don't do a canonical redirect. … … 539 539 return; 540 540 } 541 541 542 542 // build the URL in the address bar 543 543 $requested_url = is_ssl() ? 'https://' : 'http://'; 544 544 $requested_url .= $_SERVER['HTTP_HOST']; 545 545 $requested_url .= $_SERVER['REQUEST_URI']; 546 546 547 547 // Stash query args 548 548 $url_stack = explode( '?', $requested_url ); 549 549 $req_url_clean = $url_stack[0]; 550 550 551 551 // Process the redirect stack 552 552 if ( isset( $bp->redirect_stack['base_url'] ) ) { 553 553 $url_stack[0] = $bp->redirect_stack['base_url']; 554 554 } 555 555 556 556 if ( isset( $bp->redirect_stack['component'] ) ) { 557 557 $url_stack[0] = trailingslashit( $url_stack[0] . $bp->redirect_stack['component'] ); 558 558 } 559 559 560 560 if ( isset( $bp->redirect_stack['action'] ) ) { 561 561 $url_stack[0] = trailingslashit( $url_stack[0] . $bp->redirect_stack['action'] ); 562 562 } 563 563 564 564 if ( !empty( $bp->redirect_stack['action_variables'] ) ) { 565 565 foreach( (array) $bp->redirect_stack['action_variables'] as $av ) { 566 $url_stack[0] = trailingslashit( $url_stack[0] . $av ); 566 $url_stack[0] = trailingslashit( $url_stack[0] . $av ); 567 567 } 568 568 } 569 569 570 570 // Add trailing slash 571 571 $url_stack[0] = trailingslashit( $url_stack[0] ); 572 572 573 573 // Only redirect if we've assembled a URL different from the request 574 574 if ( $url_stack[0] !== $req_url_clean ) { 575 575 576 576 // Template messages have been deleted from the cookie by this point, so 577 577 // they must be readded before redirecting … … 579 579 $message = stripslashes( $bp->template_message ); 580 580 $message_type = isset( $bp->template_message_type ) ? $bp->template_message_type : 'success'; 581 581 582 582 bp_core_add_message( $message, $message_type ); 583 583 } 584 584 585 585 bp_core_redirect( implode( '?', $url_stack ) ); 586 586 } … … 598 598 * 599 599 * @since BuddyPress (1.6) 600 * @uses bp_is_blog_page() 600 * @uses bp_is_blog_page() 601 601 */ 602 602 function _bp_maybe_remove_redirect_canonical() {
Note: See TracChangeset
for help on using the changeset viewer.