Skip to:
Content

bbPress.org

Opened 3 years ago

Closed 10 months ago

Last modified 10 months ago

#3516 closed regression (fixed)

The search functionality only works for single words

Reported by: aezazshekh's profile aezazshekh Owned by: johnjamesjacoby's profile johnjamesjacoby
Milestone: 2.6.14 Priority: normal
Severity: normal Version: 2.6.0
Component: Component - Search 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
3 years ago

  • Component changed from Component - Forums to Component - Search
  • Summary changed from The search functionality of the forum search is not working properly. to 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
10 months ago

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

Confirmed.

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

Thanks everyone!

#3 @johnjamesjacoby
10 months ago

  • Owner set to johnjamesjacoby
  • Resolution set to fixed
  • Status changed from new to 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
10 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.