diff options
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acp/acp_main.php | 55 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_styles.php | 5 | ||||
-rw-r--r-- | phpBB/includes/auth/auth_db.php | 4 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_admin.php | 12 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_queue.php | 2 | ||||
-rwxr-xr-x | phpBB/includes/mcp/mcp_reports.php | 2 |
7 files changed, 59 insertions, 23 deletions
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index bf958ba319..14f6571177 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -51,6 +51,46 @@ class acp_main $action = request_var('action', ''); + if ($action && !confirm_box(true)) + { + switch ($action) + { + case 'online': + $confirm = true; + $confirm_lang = 'RESET_ONLINE_CONFIRM'; + break; + case 'stats': + $confirm = true; + $confirm_lang = 'RESYNC_STATS_CONFIRM'; + break; + case 'user': + $confirm = true; + $confirm_lang = 'RESYNC_POSTCOUNTS_CONFIRM'; + break; + case 'date': + $confirm = true; + $confirm_lang = 'RESET_DATE_CONFIRM'; + break; + case 'db_track': + $confirm = true; + $confirm_lang = 'RESYNC_POST_MARKING_CONFIRM'; + break; + + default: + $confirm = true; + $confirm_lang = 'CONFIRM_OPERATION'; + } + + if ($confirm) + { + confirm_box(false, $user->lang[$confirm_lang], build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'action' => $action, + ))); + } + } + switch ($action) { case 'online': @@ -74,29 +114,23 @@ class acp_main FROM ' . POSTS_TABLE . ' WHERE post_approved = 1'; $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); + set_config('num_posts', (int) $db->sql_fetchfield('stat'), true); $db->sql_freeresult($result); - set_config('num_posts', (int) $row['stat'], true); - $sql = 'SELECT COUNT(topic_id) AS stat FROM ' . TOPICS_TABLE . ' WHERE topic_approved = 1'; $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); + set_config('num_topics', (int) $db->sql_fetchfield('stat'), true); $db->sql_freeresult($result); - set_config('num_topics', (int) $row['stat'], true); - $sql = 'SELECT COUNT(user_id) AS stat FROM ' . USERS_TABLE . ' WHERE user_type IN (' . USER_NORMAL . ',' . USER_FOUNDER . ')'; $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); + set_config('num_users', (int) $db->sql_fetchfield('stat'), true); $db->sql_freeresult($result); - set_config('num_users', (int) $row['stat'], true); - $sql = 'SELECT COUNT(attach_id) as stat FROM ' . ATTACHMENTS_TABLE . ' WHERE is_orphan = 0'; @@ -296,7 +330,6 @@ class acp_main } $dbsize = get_database_size(); - $s_action_options = build_select(array('online' => 'RESET_ONLINE', 'date' => 'RESET_DATE', 'stats' => 'RESYNC_STATS', 'user' => 'RESYNC_POSTCOUNTS', 'db_track' => 'RESYNC_POST_MARKING')); $template->assign_vars(array( 'TOTAL_POSTS' => $total_posts, @@ -320,7 +353,7 @@ class acp_main 'U_ADMIN_LOG' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&mode=admin'), 'U_INACTIVE_USERS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=inactive&mode=list'), - 'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? $s_action_options : '', + 'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? true : false, ) ); diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index ec69944f5e..2a7b993cd9 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -939,6 +939,9 @@ parse_css_file = {PARSE_CSS_FILE} $add_custom = isset($_POST['add_custom']) ? true : false; $matches = array(); + // no curly brackets inside a CSS block please + $css_data = str_replace(array('{', '}'), '', $css_data); + // Retrieve some information about the theme $sql = 'SELECT theme_storedb, theme_path, theme_name, theme_data FROM ' . STYLES_THEME_TABLE . " @@ -1266,7 +1269,7 @@ parse_css_file = {PARSE_CSS_FILE} else { // check whether the custom class name is valid - if (!preg_match('/^[a-z0-9\.,:#_\->*]+$/i', $custom_class)) + if (!preg_match('/^[a-z0-9\.,:#_\ \t->*]+$/i', $custom_class)) { trigger_error($user->lang['THEME_ERR_CLASS_CHARS'] . adm_back_link($this->u_action . "&action=edit&id=$theme_id&text_rows=$text_rows"), E_USER_WARNING); } diff --git a/phpBB/includes/auth/auth_db.php b/phpBB/includes/auth/auth_db.php index 3be896cfd6..baf193ecdb 100644 --- a/phpBB/includes/auth/auth_db.php +++ b/phpBB/includes/auth/auth_db.php @@ -98,9 +98,9 @@ function login_db(&$username, &$password) // If the password convert flag is set we need to convert it if ($row['user_pass_convert']) { - // in phpBB2 passwords were used exactly as they were sent + // in phpBB2 passwords were used exactly as they were sent, with addslashes applied $password_old_format = isset($_REQUEST['password']) ? (string) $_REQUEST['password'] : ''; - $password_old_format = (STRIP) ? stripslashes($password_old_format) : $password_old_format; + $password_old_format = (!STRIP) ? addslashes($password_old_format) : $password_old_format; $password_new_format = ''; set_var($password_new_format, $password_old_format, 'string'); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 7e1a7ac679..8639df6ab0 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2398,7 +2398,7 @@ function make_clickable($text, $server_url = false) // relative urls for this board $magic_url_match[] = '#(^|[\n\t (])(' . preg_quote($server_url, '#') . ')/(' . get_preg_expression('relative_url_inline') . ')#ie'; - $magic_url_replace[] = "'\$1<!-- l --><a href=\"\$2/' . preg_replace('/(&|\?)sid=[0-9a-f]{32}/', '\\\\1', '\$3') . '\">' . preg_replace('/(&|\?)sid=[0-9a-f]{32}/', '\\\\1', '\$3') . '</a><!-- l -->'"; + $magic_url_replace[] = "'\$1<!-- l --><a href=\"\$2/' . preg_replace('/(&|\?)sid=[0-9a-f]{32}/', '\\\\1', '\$3') . '\">' . ((strlen('\$3')) ? preg_replace('/(&|\?)sid=[0-9a-f]{32}/', '\\\\1', '\$3') : '\$2/') . '</a><!-- l -->'"; // matches a xxxx://aaaaa.bbb.cccc. ... $magic_url_match[] = '#(^|[\n\t (])(' . get_preg_expression('url_inline') . ')#ie'; diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index e0b7b8a554..f319873e2c 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -495,7 +495,7 @@ function move_posts($post_ids, $topic_id, $auto_sync = true) /** * Remove topic(s) */ -function delete_topics($where_type, $where_ids, $auto_sync = true) +function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_sync = true) { global $db, $config; @@ -517,7 +517,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true) } $return = array( - 'posts' => delete_posts($where_type, $where_ids, false, true) + 'posts' => delete_posts($where_type, $where_ids, false, true, $post_count_sync) ); $sql = 'SELECT topic_id, forum_id, topic_approved @@ -579,7 +579,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true) /** * Remove post(s) */ -function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = true) +function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = true, $post_count_sync = true) { global $db, $config, $phpbb_root_path, $phpEx; @@ -612,7 +612,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = $topic_ids[] = $row['topic_id']; $forum_ids[] = $row['forum_id']; - if ($row['post_postcount']) + if ($row['post_postcount'] && $post_count_sync) { $post_counts[$row['poster_id']] = (!empty($post_counts[$row['poster_id']])) ? $post_counts[$row['poster_id']] + 1 : 1; } @@ -642,7 +642,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = unset($table_ary); // Adjust users post counts - if (sizeof($post_counts)) + if (sizeof($post_counts) && $post_count_sync) { foreach ($post_counts as $poster_id => $substract) { @@ -1896,7 +1896,7 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync $topic_list = array_unique($topic_list); } - return delete_topics('topic_id', $topic_list, $auto_sync); + return delete_topics('topic_id', $topic_list, $auto_sync, false); } /** diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 6378295191..6733a73a7e 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -379,7 +379,7 @@ class mcp_queue 'S_MCP_ACTION' => build_url(array('t', 'f', 'sd', 'st', 'sk')), 'S_TOPICS' => ($mode == 'unapproved_posts') ? false : true, - 'PAGINATION' => generate_pagination($this->u_action . "&f=$forum_id", $total, $config['topics_per_page'], $start), + 'PAGINATION' => generate_pagination($this->u_action . "&f=$forum_id&st=$sort_days&sk=$sort_key&sd=$sort_dir", $total, $config['topics_per_page'], $start), 'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start), 'TOPIC_ID' => $topic_id, 'TOTAL' => $total) diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index a57dadb301..a4cd1dd5d1 100755 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -353,7 +353,7 @@ class mcp_reports 'S_FORUM_OPTIONS' => $forum_options, 'S_CLOSED' => ($mode == 'reports_closed') ? true : false, - 'PAGINATION' => generate_pagination($this->u_action . "&f=$forum_id&t=$topic_id", $total, $config['topics_per_page'], $start), + 'PAGINATION' => generate_pagination($this->u_action . "&f=$forum_id&t=$topic_id&st=$sort_days&sk=$sort_key&sd=$sort_dir", $total, $config['topics_per_page'], $start), 'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start), 'TOPIC_ID' => $topic_id, 'TOTAL' => $total, |