diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index da403c5fbf..84093953b0 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -117,6 +117,7 @@
[Fix] Display assigned rank/avatar for guests. (Bug #19155)
[Fix] Set secure cookie for style switcher if required. (Bug #19625)
[Fix] Fix native full text search on postgresql while using excluding keyword matches. (Bug #19195)
+ [Fix] Pass S_SEARCH_ACTION through append_sid() in search.php. (Bug #21585)
[Change] No longer allow the direct use of MULTI_INSERT in sql_build_array. sql_multi_insert() must be used.
[Change] Display warning in ACP if config.php file is left writable.
diff --git a/phpBB/search.php b/phpBB/search.php
index 0066680457..3a8b3cdc0d 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -1053,7 +1053,7 @@ if (!empty($_EXTRA_URL))
}
$template->assign_vars(array(
- 'S_SEARCH_ACTION' => "{$phpbb_root_path}search.$phpEx",
+ 'S_SEARCH_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx", false, true, 0), // We force no ?sid= appending by using 0
'S_HIDDEN_FIELDS' => build_hidden_fields($s_hidden_fields),
'S_CHARACTER_OPTIONS' => $s_characters,
'S_FORUM_OPTIONS' => $s_forums,