Search query string gets double encoded when core Search block form is submitted

Created on 16 July 2012, over 12 years ago
Updated 27 January 2023, almost 2 years ago

Hello,

RE: Lines 1506-1510 in apachesolr_seach.module

// Replace keys with their rawurldecoded value
if (isset($fv['search_block_form'])) {
$raw_keys = rawurlencode($fv['search_block_form']);
$form_state['redirect'] = str_replace($fv['search_block_form'], $raw_keys, $form_state['redirect']);
}

The comment says the keys will be replaced with urldecoded value, while the code replaces the keys with the urlencoded value.

This was the apparant cause for the double encoding of our search string on the search results page. The problem disappeared once I changed:
$raw_keys = rawurlencode($fv['search_block_form']) TO $raw_keys = rawurldecode($fv['search_block_form']);

Is this a legitimate bug or am I missing something? Let me know if I should generate a patch.

Thank you for all your hard work.

Regards,
Mike

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States HalfChem

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024