Skip to:
Content

bbPress.org


Ignore:
Timestamp:
04/18/2019 07:54:43 PM (6 years ago)
Author:
johnjamesjacoby
Message:

Search: add support for fs query-arg to search forums list:

  • Introduces bbp_sanitize_search_request() to encapsulate duplicate code across forums/topics/replies
  • Introduces bbp_get_search_type_ids() to stub out future enhancements (tags, users, etc...)
  • Use these new functions where intended
  • Update bbp_get_search_terms() to loop through known search-type IDs

This commit also fixes debug notices that would happen when these query arguments were not explicitly strings.

Fixes #3245.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/replies/template.php

    r6902 r6903  
    130130
    131131    // Other defaults
    132     $default_reply_search   = ! empty( $_REQUEST['rs'] ) ? $_REQUEST['rs'] : false;
     132    $default_reply_search   = bbp_sanitize_search_request( 'rs' );
    133133    $default_post_parent    = ( bbp_is_single_topic() ) ? bbp_get_topic_id() : 'any';
    134134    $default_post_type      = ( bbp_is_single_topic() && bbp_show_lead_topic() ) ? bbp_get_reply_post_type() : array( bbp_get_topic_post_type(), bbp_get_reply_post_type() );
Note: See TracChangeset for help on using the changeset viewer.