Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/19/2010 07:41:13 PM (16 years ago)
Author:
djpaul
Message:

Add missing files from previous commit (r3448); don't allow the URL to override search parameters hardcoded in templates.

File:
1 edited

Legend:

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

    r3372 r3449  
    139139        $type = 'active';
    140140        $user_id = false;
    141         $search_terms = false;
     141        $search_terms = null;
    142142        $slug = false;
    143143
    … …  
    160160        }
    161161
    162         if ( isset( $_REQUEST['group-filter-box'] ) || isset( $_REQUEST['s'] ) )
    163                 $search_terms = ( isset( $_REQUEST['group-filter-box'] ) ) ? $_REQUEST['group-filter-box'] : $_REQUEST['s'];
    164 
    165162        $defaults = array(
    166163                'type' => $type,
    … …  
    180177        $r = wp_parse_args( $args, $defaults );
    181178        extract( $r );
     179
     180        if ( is_null( $search_terms ) ) {
     181                if ( isset( $_REQUEST['group-filter-box'] ) && !empty( $_REQUEST['group-filter-box'] ) )
     182                        $search_terms = $_REQUEST['group-filter-box'];
     183                elseif ( isset( $_REQUEST['s'] ) && !empty( $_REQUEST['s'] ) )
     184                        $search_terms = $_REQUEST['s'];
     185                else
     186                        $search_terms = false;
     187        }
    182188
    183189        $groups_template = new BP_Groups_Template( (int)$user_id, $type, (int)$page, (int)$per_page, (int)$max, $slug, $search_terms, $include, (bool)$populate_extras, $exclude );
    … …  
    18121818
    18131819        $search_value = __( 'Search anything...', 'buddypress' );
    1814         if ( !empty( $_REQUEST['s'] ) )
     1820        if ( isset( $_REQUEST['s'] ) && !empty( $_REQUEST['s'] ) )
    18151821                $search_value = $_REQUEST['s'];
    18161822
Note: See TracChangeset for help on using the changeset viewer.