- last update
over 1 year ago 25 pass - πΊπΈUnited States douggreen Winchester, VA
Updated patch is relative to the module and not docroot, so that it applies cleanly.
When setting the title of a custom search page, you can use the token '%terms' to insert the user's search terms into the title.
However, these get output with double escaping. For example, a search for "<>chief O'Brien<b>" produces the page title: "Search: <b>Chief O'Brien<b>". In particular, the apostrophe is output incorrectly.
The source of this bug is in apachesolr_search_get_value_title(). This is used as a title callback for the search page, and in apachesolr_search_menu_alter() is passed to the 'title callback' property of the menu items.
apachesolr_search_get_value_title() uses t() with a '@terms' placeholder, which runs the search terms through check_plain().
However, drupal_get_title() already has provision for sanitizing the page title, unless drupal_set_title() was called with the PASS_THROUGH option. We can't change the call to drupal_set_title(), as we're providing a menu title callback, so we shouldn't be escaping the string ourselves, but returning it raw.
Needs review
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Updated patch is relative to the module and not docroot, so that it applies cleanly.