Skip to:
Content

bbPress.org


Ignore:
Timestamp:
04/05/2020 07:21:41 PM (4 years ago)
Author:
johnjamesjacoby
Message:

Search/Rewrites: unslash search terms inside bbp_get_search_terms().

This commit ensures that search terms appear correctly inside of template output, without additional slashes.

It also eliminates a few repeated calls to bbp_get_search_rewrite_id(), and more strictly compares rewrite rule query vars to null results for improved code clarity & consistency.

Props dd32, johnjamesjacoby.

See #3357. Trunk, for 2.7.0.

File:
1 edited

Legend:

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

    r7006 r7076  
    298298
    299299            // Global
    300             if ( get_query_var( bbp_get_search_rewrite_id() ) ) {
    301                 $search_terms = get_query_var( bbp_get_search_rewrite_id() );
     300            $search_terms = get_query_var( bbp_get_search_rewrite_id(), null );
     301
     302            // Searching globally
     303            if ( ! is_null( $search_terms )  ) {
     304                $search_terms = wp_unslash( $search_terms );
    302305
    303306            // Other searches
Note: See TracChangeset for help on using the changeset viewer.