From 6e8b59dce32032cafeb39c3dc1dfe16e20194683 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Thu, 2 Jun 2011 09:44:02 +0200 Subject: [PATCH] [ticket/7057] Use GET for quicksearch and add session id to hidden fields Without sid a GET form logs a user out if they have cookies disabled. PHPBB3-7057 --- phpBB/includes/functions.php | 8 ++++++++ phpBB/styles/prosilver/template/overall_header.html | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 7cbf314309..ded69d7150 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -4422,6 +4422,12 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0 $user_lang = substr($user_lang, 0, strpos($user_lang, '-x-')); } + $s_search_hidden_fields = array(); + if ($_SID) + { + $s_search_hidden_fields['sid'] = $_SID; + } + // The following assigns all _common_ variables that may be used at any point in a template. $template->assign_vars(array( 'SITENAME' => $config['sitename'], @@ -4511,6 +4517,8 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0 'S_LOAD_UNREADS' => ($config['load_unreads_search'] && ($config['load_anon_lastread'] || $user->data['is_registered'])) ? true : false, + 'S_SEARCH_HIDDEN_FIELDS' => build_hidden_fields($s_search_hidden_fields), + 'T_THEME_PATH' => "{$web_path}styles/" . $user->theme['theme_path'] . '/theme', 'T_TEMPLATE_PATH' => "{$web_path}styles/" . $user->theme['template_path'] . '/template', 'T_SUPER_TEMPLATE_PATH' => (isset($user->theme['template_inherit_path']) && $user->theme['template_inherit_path']) ? "{$web_path}styles/" . $user->theme['template_inherit_path'] . '/template' : "{$web_path}styles/" . $user->theme['template_path'] . '/template', diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html index e537aabf56..ca9ba8ef34 100644 --- a/phpBB/styles/prosilver/template/overall_header.html +++ b/phpBB/styles/prosilver/template/overall_header.html @@ -117,7 +117,7 @@