Skip to:
Content

bbPress.org

Opened 4 years ago

Closed 17 months ago

Last modified 17 months ago

#3516 closed regression (fixed)

The search functionality only works for single words

Reported by: aezazshekh Owned by: johnjamesjacoby
Priority: normal Milestone: 2.6.14
Component: Component - Search Version: 2.6.0
Severity: normal Keywords: commit
Cc:

Description

If we search the title of the topic in the forum search of ​https://bbpress.org/forums/forum/plugins/ page, the result is not properly displayed.

URL => ​https://bbpress.org/forums/forum/plugins/
Issue Video Link => ​https://share.cleanshot.com/Fhj9dqJbV1y4nj8mvDt7

Change History (4)

#1 @dd32
4 years ago

  • Component Component - Forums → Component - Search
  • Summary The search functionality of the forum search is not working properly. → The search functionality only works for single words

Video summarised:

  • Searching multiple words doesn't work.

This happens as ​bbp_sanitize_search_request() applies sanitize_title() and so in the example of searching for some questions looks for posts in the forums with some-questions in the title/content of the forum posts.

#2 @johnjamesjacoby
17 months ago

  • Keywords commit added; needs-patch removed
  • Milestone Awaiting Review → 2.6.14
  • Type defect (bug) → regression
  • Version → 2.6.0

Confirmed.

That sanitize_title() call should be sanitize_text_field() instead.

Thanks everyone!

#3 @johnjamesjacoby
17 months ago

  • Owner set to johnjamesjacoby
  • Resolution → fixed
  • Status new → closed

In 7332:

Search: use correct sanitization function inside of bbp_sanitize_search_request().

This change fixes a bug causing forum/topic/reply specific searches to fail when searching for more than 1 word, by swapping out sanitize_title() with sanitize_text_field().

Props dd32, aezazshekh.

In branches/2.6, for 2.6.14.

Fixes #3516.

#4 @johnjamesjacoby
17 months ago

In 7333:

Search: use correct sanitization function inside of bbp_sanitize_search_request().

This change fixes a bug causing forum/topic/reply specific searches to fail when searching for more than 1 word, by swapping out sanitize_title() with sanitize_text_field().

Props dd32, aezazshekh.

In trunk, for 2.7.

Fixes #3516.

Note: See TracTickets for help on using tickets.