Opened 4 years ago
Closed 4 years ago
#3357 closed defect (bug) (fixed)
Search redirect fails to wp_unslash()
Reported by: | dd32 | Owned by: | johnjamesjacoby |
---|---|---|---|
Milestone: | 2.6.5 | Priority: | normal |
Severity: | normal | Version: | 2.1 |
Component: | Component - Search | Keywords: | commit |
Cc: |
Description
As reported in https://meta.trac.wordpress.org/ticket/2024 bbPress fails to unslash the search term before redirecting to a slashed variant.
For example, search for "wordpress"
will result in a redirect that ultimately uses \"wordpress\"
in the displays. Oddly enough it looks like the actual search works properly, so the slash stripping might be working at a lower level.
Examples:
https://bbpress.org/forums/search/?action=bbp-search-request&bbp_search=%22wordpress%22
https://de.wordpress.org/support/search/?action=bbp-search-request&bbp_search=%22wordpress%22
I suspect bbp_get_search_terms()
needs a wp_unslash()
wrapped around get_query_var( bbp_get_search_rewrite_id() )
but I'm unsure how that will play out with url rewrites.
I tested this morning, and adding
wp_slash()
where you suggested is the correct approach.Rewrite rules continue to function normally.
Going to commit that change alongside other rewrite/search code improvements.