diff --git a/build/build.xml b/build/build.xml index b732521e3e..100795663b 100644 --- a/build/build.xml +++ b/build/build.xml @@ -49,7 +49,7 @@ --> @@ -270,7 +270,7 @@ command="git archive ${revision} composer.phar | tar -xf - -C ${dir}" checkreturn="true" /> diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index e556193fdf..35c6877a89 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -794,6 +794,22 @@ mcp_ban_unban_before * Since: 3.1.0-RC3 * Purpose: Add additional fields to the unban form in MCP +mcp_forum_actions_after +=== +* Locations: + + styles/prosilver/template/mcp_forum.html + + styles/subsilver2/template/mcp_forum.html +* Since: 3.1.11-RC1 +* Purpose: Add some information after actions fieldset + +mcp_forum_actions_before +=== +* Locations: + + styles/prosilver/template/mcp_forum.html + + styles/subsilver2/template/mcp_forum.html +* Since: 3.1.11-RC1 +* Purpose: Add some information before actions fieldset + mcp_forum_topic_title_before === * Locations: diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 16655ff4cb..dd0599e06a 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -42,11 +42,6 @@ class acp_database $form_key = 'acp_database'; add_form_key($form_key); - if ($submit && !check_form_key($form_key)) - { - trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); - } - $template->assign_vars(array( 'MODE' => $mode )); @@ -70,6 +65,11 @@ class acp_database trigger_error($user->lang['TABLE_SELECT_ERROR'] . adm_back_link($this->u_action), E_USER_WARNING); } + if (!check_form_key($form_key)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + $store = $download = $structure = $schema_data = false; if ($where == 'store_and_download' || $where == 'store') diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index e9bc02d88b..a0ea7dc9b1 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -45,11 +45,6 @@ class acp_icons $form_key = 'acp_icons'; add_form_key($form_key); - if ($submit && !check_form_key($form_key)) - { - trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); - } - $mode = ($mode == 'smilies') ? 'smilies' : 'icons'; $this->tpl_name = 'acp_icons'; @@ -334,6 +329,11 @@ class acp_icons case 'create': case 'modify': + if (!check_form_key($form_key)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + // Get items to create/modify $images = (isset($_POST['image'])) ? array_keys(request_var('image', array('' => 0))) : array(); @@ -522,6 +522,11 @@ class acp_icons { $order = 0; + if (!check_form_key($form_key)) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + if (!($pak_ary = @file($phpbb_root_path . $img_path . '/' . $pak))) { trigger_error($user->lang['PAK_FILE_NOT_READABLE'] . adm_back_link($this->u_action), E_USER_WARNING); @@ -707,7 +712,7 @@ class acp_icons $template->assign_vars(array( 'MESSAGE_TITLE' => $user->lang['EXPORT_' . $lang], - 'MESSAGE_TEXT' => sprintf($user->lang['EXPORT_' . $lang . '_EXPLAIN'], '', ''), + 'MESSAGE_TEXT' => sprintf($user->lang['EXPORT_' . $lang . '_EXPLAIN'], '', ''), 'S_USER_NOTICE' => true, ) @@ -719,6 +724,11 @@ class acp_icons case 'send': + if (!check_link_hash($request->variable('hash', ''), 'acp_icons')) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + $sql = "SELECT * FROM $table ORDER BY {$fields}_order"; diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 1ea266815d..1e453e88ad 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -2274,6 +2274,12 @@ class acp_users { trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); } + + if (!check_link_hash($request->variable('hash', ''), 'acp_users')) + { + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); + } + group_user_attributes($action, $group_id, $user_id); if ($action == 'default') @@ -2431,8 +2437,8 @@ class acp_users { $template->assign_block_vars('group', array( 'U_EDIT_GROUP' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=groups&mode=manage&action=edit&u=$user_id&g={$data['group_id']}&back_link=acp_users_groups"), - 'U_DEFAULT' => $this->u_action . "&action=default&u=$user_id&g=" . $data['group_id'], - 'U_DEMOTE_PROMOTE' => $this->u_action . '&action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&u=$user_id&g=" . $data['group_id'], + 'U_DEFAULT' => $this->u_action . "&action=default&u=$user_id&g=" . $data['group_id'] . '&hash=' . generate_link_hash('acp_users'), + 'U_DEMOTE_PROMOTE' => $this->u_action . '&action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&u=$user_id&g=" . $data['group_id'] . '&hash=' . generate_link_hash('acp_users'), 'U_DELETE' => $this->u_action . "&action=delete&u=$user_id&g=" . $data['group_id'], 'U_APPROVE' => ($group_type == 'pending') ? $this->u_action . "&action=approve&u=$user_id&g=" . $data['group_id'] : '', diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index 87f2e558f5..0fb8bf1109 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -420,9 +420,11 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id) } $sync_forums = array(); + $topic_views = 0; foreach ($all_topic_data as $data) { $sync_forums[$data['forum_id']] = $data['forum_id']; + $topic_views += $data['topic_views']; } $to_topic_data = $all_topic_data[$to_topic_id]; @@ -478,6 +480,12 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id) move_posts($post_id_list, $to_topic_id, false); add_log('mod', $to_forum_id, $to_topic_id, 'LOG_MERGE', $to_topic_data['topic_title']); + // Update topic views count + $sql = 'UPDATE ' . TOPICS_TABLE . ' + SET topic_views = ' . $topic_views . ' + WHERE topic_id = ' . $to_topic_id; + $db->sql_query($sql); + // Message and return links $success_msg = 'POSTS_MERGED_SUCCESS'; diff --git a/phpBB/phpbb/db/migration/data/v31x/add_log_time_index.php b/phpBB/phpbb/db/migration/data/v31x/add_log_time_index.php new file mode 100644 index 0000000000..f53eedcd49 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v31x/add_log_time_index.php @@ -0,0 +1,46 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v31x; + +class add_log_time_index extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v319', + ); + } + + public function update_schema() + { + return array( + 'add_index' => array( + $this->table_prefix . 'log' => array( + 'log_time' => array('log_time'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_keys' => array( + $this->table_prefix . 'log' => array( + 'log_time', + ), + ), + ); + } +} diff --git a/phpBB/search.php b/phpBB/search.php index 03575f7e0b..27ec8e4dab 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -690,8 +690,10 @@ if ($keywords || $author || $author_id || $search_id || $submit) * @var string show_results String indicating the show results mode * @var string sql_where The SQL WHERE string used by search to get topic data * @var int total_match_count The total number of search matches + * @var array ex_fid_ary Array of excluded forum ids * @since 3.1.7-RC1 * @changed 3.1.10-RC1 Added show_results, sql_where, total_match_count + * @changed 3.1.11-RC1 Added ex_fid_ary */ $vars = array( 'u_search', @@ -699,6 +701,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) 'show_results', 'sql_where', 'total_match_count', + 'ex_fid_ary', ); extract($phpbb_dispatcher->trigger_event('core.search_modify_url_parameters', compact($vars))); @@ -1060,7 +1063,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&t=$result_topic_id", true, $user->session_id) : ''; $u_mcp_queue = (!$u_mcp_queue && $topic_deleted) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&mode=deleted_topics&t=$result_topic_id", true, $user->session_id) : $u_mcp_queue; - $row['topic_title'] = preg_replace('#(?!<.*)(?]*(?:)#is', '$1', $row['topic_title']); + $row['topic_title'] = preg_replace('#(?!<.*)(?]*(?:)#isu', '$1', $row['topic_title']); $tpl_ary = array( 'TOPIC_AUTHOR' => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), @@ -1143,8 +1146,8 @@ if ($keywords || $author || $author_id || $search_id || $submit) if ($hilit) { // post highlighting - $row['post_text'] = preg_replace('#(?!<.*)(?]*(?:)#is', '$1', $row['post_text']); - $row['post_subject'] = preg_replace('#(?!<.*)(?]*(?:)#is', '$1', $row['post_subject']); + $row['post_text'] = preg_replace('#(?!<.*)(?]*(?:)#isu', '$1', $row['post_text']); + $row['post_subject'] = preg_replace('#(?!<.*)(?]*(?:)#isu', '$1', $row['post_subject']); } $tpl_ary = array( diff --git a/phpBB/styles/prosilver/template/mcp_forum.html b/phpBB/styles/prosilver/template/mcp_forum.html index 3033ef799c..5858a2c801 100644 --- a/phpBB/styles/prosilver/template/mcp_forum.html +++ b/phpBB/styles/prosilver/template/mcp_forum.html @@ -120,6 +120,7 @@ +