Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/07/2023 07:47:34 AM (14 months ago)
Author:
imath
Message:

Do 404 when trying to reach a page about an unregistered group type

Improves the way we handle this case making sure we really end up to a
404 if the corresponding group type is not registered or do not support
directory filtering. Update corresponding PHP unit tests to really test
this case instead of a case about a member type.

Closes https://github.com/buddypress/buddypress/pull/82
Fixes #8866

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-template.php

    r13443 r13448  
    27802780 */
    27812781function bp_is_groups_directory() {
    2782     if ( bp_is_groups_component() && ! bp_is_group() && ( ! bp_current_action() || ( bp_action_variable() && bp_is_current_action( bp_get_groups_group_type_base() ) ) ) ) {
    2783         return true;
    2784     }
    2785 
    2786     return false;
     2782    $return = false;
     2783
     2784    if ( bp_is_groups_component() && ! bp_is_group() ) {
     2785        $return = ! bp_current_action() || ! empty( buddypress()->groups->current_directory_type );
     2786    }
     2787
     2788    return $return;
    27872789}
    27882790
Note: See TracChangeset for help on using the changeset viewer.