Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/13/2011 09:54:52 PM (15 years ago)
Author:
boonebgorges
Message:

Introduces bp_do_404() for easy 404ing. Corrects invalid path handling throughout, using bp_do_404(). Fixes #3280. Props DJPaul

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-screens.php

    r4442 r4506  
    104104
    105105function groups_screen_group_forum() {
    106         global $bp, $wp_query;
     106        global $bp;
    107107
    108108        if ( !bp_is_active( 'forums' ) || !bp_forums_is_installed_correctly() )
    109109                return false;
    110110
    111         if ( bp_is_single_item() && $bp->groups->current_group->user_has_access ) {
     111        if ( !empty( $bp->action_variables[0] ) && 'topic' != $bp->action_variables[0] ) {
     112                bp_do_404();
     113                return;
     114        }
     115
     116        if ( !$bp->groups->current_group->user_has_access ) {
     117                bp_core_no_access();
     118                return;
     119        }
     120
     121        if ( bp_is_single_item() ) {
    112122
    113123                // Fetch the details we need
     
    311321                // Forum topic does not exist
    312322                } elseif ( !empty( $topic_slug ) && empty( $topic_id ) ) {
    313                         $wp_query->set_404();
    314                         status_header( 404 );
    315                         nocache_headers();
     323                        bp_do_404();
    316324                        return;
    317325
     
    390398                        // Send the invites.
    391399                        groups_send_invites( $bp->loggedin_user->id, $bp->groups->current_group->id );
    392 
    393400                        bp_core_add_message( __('Group invites sent.', 'buddypress') );
    394 
    395401                        do_action( 'groups_screen_group_invite', $bp->groups->current_group->id );
    396 
    397402                        bp_core_redirect( bp_get_group_permalink( $bp->groups->current_group ) );
    398                 } else {
     403
     404                } elseif ( empty( $bp->action_variables[0] ) ) {
    399405                        // Show send invite page
    400406                        bp_core_load_template( apply_filters( 'groups_template_group_invite', 'groups/single/home' ) );
     407
     408                } else {
     409                        bp_do_404();
    401410                }
    402411        }
Note: See TracChangeset for help on using the changeset viewer.