Skip to:
Content

BuddyPress.org

Changeset 3449


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

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

Location:
trunk
Files:
2 edited

Legend:

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

    r3369 r3449  
    124124    $user_id = false;
    125125    $page = 1;
    126     $search_terms = false;
     126    $search_terms = null;
    127127
    128128    // User filtering
    129129    if ( !empty( $bp->displayed_user->id ) )
    130130        $user_id = $bp->displayed_user->id;
    131 
    132     // Pass a filter if ?s= is set.
    133     if ( isset( $_REQUEST['s'] ) && !empty( $_REQUEST['s'] ) )
    134         $search_terms = $_REQUEST['s'];
    135131
    136132    // type: active ( default ) | random | newest | popular | online | alphabetical
     
    152148    $r = wp_parse_args( $args, $defaults );
    153149    extract( $r );
     150
     151    // Pass a filter if ?s= is set.
     152    if ( is_null( $search_terms ) ) {
     153        if ( isset( $_REQUEST['s'] ) && !empty( $_REQUEST['s'] ) )
     154            $search_terms = $_REQUEST['s'];
     155        else
     156            $search_terms = false;
     157    }
    154158
    155159    if ( $max ) {
  • 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.