diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html
index b9e222bff1..5ea1330aab 100644
--- a/phpBB/styles/prosilver/template/viewforum_body.html
+++ b/phpBB/styles/prosilver/template/viewforum_body.html
@@ -45,11 +45,11 @@
-
diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html
index 05c2b91a2e..5b9102e6d2 100644
--- a/phpBB/styles/prosilver/template/viewtopic_body.html
+++ b/phpBB/styles/prosilver/template/viewtopic_body.html
@@ -38,12 +38,11 @@
-
diff --git a/phpBB/styles/subsilver2/template/searchbox.html b/phpBB/styles/subsilver2/template/searchbox.html
index cb0bb5ba73..09b87a15d8 100644
--- a/phpBB/styles/subsilver2/template/searchbox.html
+++ b/phpBB/styles/subsilver2/template/searchbox.html
@@ -1 +1 @@
-
+
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index c53150d89b..7b957482e8 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -272,6 +272,12 @@ $post_alt = ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->lang['FORUM_LO
// Display active topics?
$s_display_active = ($forum_data['forum_type'] == FORUM_CAT && ($forum_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS)) ? true : false;
+$s_search_hidden_fields = array('fid' => $forum_id);
+if ($_SID)
+{
+ $s_search_hidden_fields['sid'] = $_SID;
+}
+
$template->assign_vars(array(
'MODERATORS' => (!empty($moderators[$forum_id])) ? implode(', ', $moderators[$forum_id]) : '',
@@ -309,7 +315,8 @@ $template->assign_vars(array(
'S_WATCHING_FORUM' => $s_watching_forum['is_watching'],
'S_FORUM_ACTION' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . (($start == 0) ? '' : "&start=$start")),
'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('u_search') && $auth->acl_get('f_search', $forum_id) && $config['load_search']) ? true : false,
- 'S_SEARCHBOX_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx", 'fid[]=' . $forum_id),
+ 'S_SEARCHBOX_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx"),
+ 'S_SEARCH_HIDDEN_FIELDS' => build_hidden_fields($s_search_hidden_fields),
'S_SINGLE_MODERATOR' => (!empty($moderators[$forum_id]) && sizeof($moderators[$forum_id]) > 1) ? false : true,
'S_IS_LOCKED' => ($forum_data['forum_status'] == ITEM_LOCKED) ? true : false,
'S_VIEWFORUM' => true,
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 53119e2ae7..d80659416f 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -546,6 +546,15 @@ $server_path = (!$view) ? $phpbb_root_path : generate_board_url() . '/';
// Replace naughty words in title
$topic_data['topic_title'] = censor_text($topic_data['topic_title']);
+$s_search_hidden_fields = array(
+ 't' => $topic_id,
+ 'sf' => 'msgonly',
+);
+if ($_SID)
+{
+ $s_search_hidden_fields['sid'] = $_SID;
+}
+
// Send vars to template
$template->assign_vars(array(
'FORUM_ID' => $forum_id,
@@ -597,7 +606,8 @@ $template->assign_vars(array(
'S_VIEWTOPIC' => true,
'S_DISPLAY_SEARCHBOX' => ($auth->acl_get('u_search') && $auth->acl_get('f_search', $forum_id) && $config['load_search']) ? true : false,
- 'S_SEARCHBOX_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx", 't=' . $topic_id),
+ 'S_SEARCHBOX_ACTION' => append_sid("{$phpbb_root_path}search.$phpEx"),
+ 'S_SEARCH_HIDDEN_FIELDS' => build_hidden_fields($s_search_hidden_fields),
'S_DISPLAY_POST_INFO' => ($topic_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS)) ? true : false,
'S_DISPLAY_REPLY_INFO' => ($topic_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_reply', $forum_id) || $user->data['user_id'] == ANONYMOUS)) ? true : false,