diff options
Diffstat (limited to 'phpBB/includes')
74 files changed, 202 insertions, 365 deletions
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 00dd209c6f..6e9360f599 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -709,8 +709,6 @@ class acp_attachments $forum_ids = array(); } - $extensions = array(); - $sql = 'SELECT * FROM ' . EXTENSIONS_TABLE . " WHERE group_id = $group_id @@ -1572,7 +1570,6 @@ class acp_attachments if ($ip_2_counter == 0 && $ip_2_end == 254) { $ip_2_counter = 256; - $ip_2_fragment = 256; $iplist[] = "'$ip_1_counter.*'"; } @@ -1585,7 +1582,6 @@ class acp_attachments if ($ip_3_counter == 0 && $ip_3_end == 254) { $ip_3_counter = 256; - $ip_3_fragment = 256; $iplist[] = "'$ip_1_counter.$ip_2_counter.*'"; } @@ -1598,7 +1594,6 @@ class acp_attachments if ($ip_4_counter == 0 && $ip_4_end == 254) { $ip_4_counter = 256; - $ip_4_fragment = 256; $iplist[] = "'$ip_1_counter.$ip_2_counter.$ip_3_counter.*'"; } diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php index 286bc92813..5aed78be08 100644 --- a/phpBB/includes/acp/acp_ban.php +++ b/phpBB/includes/acp/acp_ban.php @@ -195,7 +195,6 @@ class acp_ban case 'user': $field = 'username'; - $l_ban_cell = $user->lang['USERNAME']; $sql = 'SELECT b.*, u.user_id, u.username, u.username_clean FROM ' . BANLIST_TABLE . ' b, ' . USERS_TABLE . ' u @@ -208,7 +207,6 @@ class acp_ban case 'ip': $field = 'ban_ip'; - $l_ban_cell = $user->lang['IP_HOSTNAME']; $sql = 'SELECT * FROM ' . BANLIST_TABLE . ' @@ -221,7 +219,6 @@ class acp_ban case 'email': $field = 'ban_email'; - $l_ban_cell = $user->lang['EMAIL_ADDRESS']; $sql = 'SELECT * FROM ' . BANLIST_TABLE . ' diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index c9225a7eae..dab18289c7 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -25,14 +25,15 @@ class acp_bbcodes function main($id, $mode) { - global $db, $user, $auth, $template, $cache, $request, $phpbb_dispatcher, $phpbb_container; - global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_log; + global $db, $user, $template, $cache, $request, $phpbb_dispatcher, $phpbb_container; + global $phpbb_log; $user->add_lang('acp/posting'); // Set up general vars $action = $request->variable('action', ''); $bbcode_id = $request->variable('bbcode', 0); + $submit = $request->is_set_post('submit'); $this->tpl_name = 'acp_bbcodes'; $this->page_title = 'ACP_BBCODES'; @@ -40,6 +41,11 @@ class acp_bbcodes 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); + } + // Set up mode-specific vars switch ($action) { diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 5a0ede1de3..26663d2a62 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -30,13 +30,12 @@ class acp_board function main($id, $mode) { - global $db, $user, $auth, $template, $request; - global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $user, $template, $request; + global $config, $phpbb_root_path, $phpEx; global $cache, $phpbb_container, $phpbb_dispatcher, $phpbb_log; $user->add_lang('acp/board'); - $action = $request->variable('action', ''); $submit = (isset($_POST['submit']) || isset($_POST['allow_quick_reply_enable'])) ? true : false; $form_key = 'acp_board'; @@ -760,7 +759,7 @@ class acp_board */ function select_auth_method($selected_method, $key = '') { - global $phpbb_root_path, $phpEx, $phpbb_container; + global $phpbb_container; /* @var $auth_providers \phpbb\auth\provider_collection */ $auth_providers = $phpbb_container->get('auth.provider_collection'); @@ -940,8 +939,6 @@ class acp_board */ function board_disable($value, $key) { - global $user; - $radio_ary = array(1 => 'YES', 0 => 'NO'); return h_radio('config[board_disable]', $radio_ary, $value) . '<br /><input id="' . $key . '" type="text" name="config[board_disable_msg]" maxlength="255" size="40" value="' . $this->new_config['board_disable_msg'] . '" />'; @@ -1051,8 +1048,6 @@ class acp_board */ function select_news_forums($value, $key) { - global $user, $config; - $forum_list = make_forum_select(false, false, true, true, true, false, true); // Build forum options @@ -1070,8 +1065,6 @@ class acp_board function select_exclude_forums($value, $key) { - global $user, $config; - $forum_list = make_forum_select(false, false, true, true, true, false, true); // Build forum options @@ -1127,7 +1120,7 @@ class acp_board */ function enable_mod_rewrite($value, $key) { - global $user, $config; + global $user; // Determine whether mod_rewrite is enabled on the server // NOTE: This only works on Apache servers on which PHP is NOT diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php index 422e1e34d7..e89b16663c 100644 --- a/phpBB/includes/acp/acp_bots.php +++ b/phpBB/includes/acp/acp_bots.php @@ -25,8 +25,8 @@ class acp_bots function main($id, $mode) { - global $config, $db, $user, $auth, $template, $cache, $request, $phpbb_log; - global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; + global $config, $db, $user, $template, $cache, $request, $phpbb_log; + global $phpbb_root_path, $phpEx; $action = $request->variable('action', ''); $submit = (isset($_POST['submit'])) ? true : false; diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php index 9a3b86a16a..b49c5ca0d3 100644 --- a/phpBB/includes/acp/acp_captcha.php +++ b/phpBB/includes/acp/acp_captcha.php @@ -25,8 +25,8 @@ class acp_captcha function main($id, $mode) { - global $user, $auth, $template, $phpbb_log, $request; - global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container; + global $user, $template, $phpbb_log, $request; + global $config, $phpbb_container; $user->add_lang('acp/board'); @@ -178,7 +178,7 @@ class acp_captcha */ function deliver_demo($selected) { - global $db, $user, $config, $phpbb_container; + global $phpbb_container; $captcha = $phpbb_container->get('captcha.factory')->get_instance($selected); $captcha->init(CONFIRM_REG); diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 984301a38f..c9d24f9254 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -37,7 +37,6 @@ class acp_database $this->page_title = 'ACP_DATABASE'; $action = $request->variable('action', ''); - $submit = (isset($_POST['submit'])) ? true : false; $template->assign_vars(array( 'MODE' => $mode diff --git a/phpBB/includes/acp/acp_disallow.php b/phpBB/includes/acp/acp_disallow.php index b2a7128209..70eb398d07 100644 --- a/phpBB/includes/acp/acp_disallow.php +++ b/phpBB/includes/acp/acp_disallow.php @@ -25,8 +25,7 @@ class acp_disallow function main($id, $mode) { - global $db, $user, $auth, $template, $cache, $phpbb_log, $request; - global $config, $phpbb_admin_path; + global $db, $user, $template, $cache, $phpbb_log, $request; $user->add_lang('acp/posting'); diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php index 98c74ff8b3..57eefad02d 100644 --- a/phpBB/includes/acp/acp_email.php +++ b/phpBB/includes/acp/acp_email.php @@ -25,8 +25,8 @@ class acp_email function main($id, $mode) { - global $config, $db, $user, $auth, $template, $cache, $phpbb_log, $request; - global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $phpbb_dispatcher; + global $config, $db, $user, $template, $phpbb_log, $request; + global $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_dispatcher; $user->add_lang('acp/email'); $this->tpl_name = 'acp_email'; diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index 7bcf6e1957..9fbf2f20f1 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -34,7 +34,7 @@ class acp_extensions function main() { // Start the page - global $config, $user, $template, $request, $phpbb_extension_manager, $db, $phpbb_root_path, $phpEx, $phpbb_log, $cache; + global $config, $user, $template, $request, $phpbb_extension_manager, $db, $phpbb_root_path, $phpbb_log, $cache; $this->db = $db; $this->config = $config; @@ -122,8 +122,6 @@ class acp_extensions 'U_ACTION' => $this->u_action, )); - add_form_key('version_check_settings'); - $this->tpl_name = 'acp_ext_list'; break; @@ -541,7 +539,7 @@ class acp_extensions $version_helper = new \phpbb\version_helper($this->cache, $this->config, new \phpbb\file_downloader(), $this->user); $version_helper->set_current_version($meta['version']); - $version_helper->set_file_location($version_check['host'], $version_check['directory'], $version_check['filename']); + $version_helper->set_file_location($version_check['host'], $version_check['directory'], $version_check['filename'], isset($version_check['ssl']) ? $version_check['ssl'] : false); $version_helper->force_stability($this->config['extension_force_unstable'] ? 'unstable' : null); return $updates = $version_helper->get_suggested_updates($force_update, $force_cache); diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 7f1e629875..c5d2d0ea09 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -27,7 +27,7 @@ class acp_forums function main($id, $mode) { global $db, $user, $auth, $template, $cache, $request, $phpbb_dispatcher; - global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx, $phpbb_log; + global $phpbb_admin_path, $phpbb_root_path, $phpEx, $phpbb_log; $user->add_lang('acp/forums'); $this->tpl_name = 'acp_forums'; @@ -1264,8 +1264,6 @@ class acp_forums return array($user->lang['NO_FORUM']); } - $subforums_to_name = $_row['forum_name']; - $sql = 'SELECT forum_id FROM ' . FORUMS_TABLE . " WHERE parent_id = {$row['forum_id']}"; @@ -1383,7 +1381,7 @@ class acp_forums { global $db, $user, $phpbb_dispatcher; - $to_data = $moved_ids = $errors = array(); + $errors = array(); // Check if we want to move to a parent with link type if ($to_id > 0) diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index c9bb4bee14..1f965b334c 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -26,7 +26,7 @@ class acp_groups function main($id, $mode) { global $config, $db, $user, $auth, $template, $cache; - global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads; + global $phpbb_root_path, $phpbb_admin_path, $phpEx; global $request, $phpbb_container, $phpbb_dispatcher; $user->add_lang('acp/groups'); @@ -306,8 +306,6 @@ class acp_groups include($phpbb_root_path . 'includes/functions_display.' . $phpEx); } - $data = $submit_ary = array(); - if ($action == 'edit' && !$group_id) { trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING); @@ -1094,7 +1092,6 @@ class acp_groups ORDER BY group_legend ASC, group_type DESC, group_name ASC'; $result = $db->sql_query($sql); - $s_group_select_legend = ''; while ($row = $db->sql_fetchrow($result)) { $group_name = $group_helper->get_name($row['group_name']); @@ -1132,7 +1129,6 @@ class acp_groups ORDER BY t.teampage_position ASC'; $result = $db->sql_query($sql); - $category_data = array(); while ($row = $db->sql_fetchrow($result)) { if ($row['teampage_id'] == $category_id) @@ -1175,7 +1171,6 @@ class acp_groups ORDER BY g.group_type DESC, g.group_name ASC'; $result = $db->sql_query($sql); - $s_group_select_teampage = ''; while ($row = $db->sql_fetchrow($result)) { $group_name = $group_helper->get_name($row['group_name']); diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index 57a36bb9f3..0293dca9d3 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -28,8 +28,8 @@ class acp_icons function main($id, $mode) { - global $db, $user, $auth, $template, $cache, $phpbb_container; - global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $db, $user, $template, $cache; + global $config, $phpbb_root_path; global $request, $phpbb_container; $user->add_lang('acp/posting'); @@ -194,7 +194,6 @@ class acp_icons $data = array(); $after = false; - $display = 0; $order_lists = array('', ''); $add_order_lists = array('', ''); $display_count = 0; @@ -209,7 +208,6 @@ class acp_icons if ($row[$fields . '_id'] == $icon_id) { $after = true; - $display = $row['display_on_posting']; $data[$row[$fields . '_url']] = $row; } else diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php index 8c021560a0..7ec43f45cc 100644 --- a/phpBB/includes/acp/acp_inactive.php +++ b/phpBB/includes/acp/acp_inactive.php @@ -32,7 +32,7 @@ class acp_inactive function main($id, $mode) { global $config, $db, $user, $auth, $template, $phpbb_container, $phpbb_log, $request; - global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; + global $phpbb_root_path, $phpbb_admin_path, $phpEx; if (!function_exists('user_active_flip')) { diff --git a/phpBB/includes/acp/acp_jabber.php b/phpBB/includes/acp/acp_jabber.php index 1726728086..5dec6bb7d4 100644 --- a/phpBB/includes/acp/acp_jabber.php +++ b/phpBB/includes/acp/acp_jabber.php @@ -29,8 +29,8 @@ class acp_jabber function main($id, $mode) { - global $db, $user, $auth, $template, $phpbb_log, $request; - global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $db, $user, $template, $phpbb_log, $request; + global $config, $phpbb_root_path, $phpEx; $user->add_lang('acp/board'); @@ -39,7 +39,6 @@ class acp_jabber include($phpbb_root_path . 'includes/functions_jabber.' . $phpEx); } - $action = $request->variable('action', ''); $submit = (isset($_POST['submit'])) ? true : false; if ($mode != 'settings') @@ -68,8 +67,6 @@ class acp_jabber trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING); } - $error = array(); - $message = $user->lang['JAB_SETTINGS_CHANGED']; $log = 'JAB_SETTINGS_CHANGED'; diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php index 56039ff302..c33ca8c4fc 100644 --- a/phpBB/includes/acp/acp_logs.php +++ b/phpBB/includes/acp/acp_logs.php @@ -25,8 +25,8 @@ class acp_logs function main($id, $mode) { - global $db, $user, $auth, $template, $cache, $phpbb_container; - global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $user, $auth, $template, $phpbb_container; + global $config; global $request; $user->add_lang('mcp'); @@ -34,7 +34,6 @@ class acp_logs // Set up general vars $action = $request->variable('action', ''); $forum_id = $request->variable('f', 0); - $topic_id = $request->variable('t', 0); $start = $request->variable('start', 0); $deletemark = $request->variable('delmarked', false, false, \phpbb\request\request_interface::POST); $deleteall = $request->variable('delall', false, false, \phpbb\request\request_interface::POST); diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php index c2407f15b4..d3ecffe81e 100644 --- a/phpBB/includes/acp/acp_modules.php +++ b/phpBB/includes/acp/acp_modules.php @@ -579,7 +579,7 @@ class acp_modules */ function make_module_select($select_id = false, $ignore_id = false, $ignore_acl = false, $ignore_nonpost = false, $ignore_emptycat = true, $ignore_noncat = false) { - global $db, $user, $auth, $config; + global $db, $user; $sql = 'SELECT module_id, module_enabled, module_basename, parent_id, module_langname, left_id, right_id, module_auth FROM ' . MODULES_TABLE . " diff --git a/phpBB/includes/acp/acp_permission_roles.php b/phpBB/includes/acp/acp_permission_roles.php index 2d71ab4c71..93aca295d7 100644 --- a/phpBB/includes/acp/acp_permission_roles.php +++ b/phpBB/includes/acp/acp_permission_roles.php @@ -26,8 +26,8 @@ class acp_permission_roles function main($id, $mode) { - global $db, $user, $auth, $template, $cache, $phpbb_container; - global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $db, $user, $template, $phpbb_container; + global $phpbb_root_path, $phpEx; global $request, $phpbb_log; if (!function_exists('user_get_id_name')) @@ -477,7 +477,7 @@ class acp_permission_roles */ function display_auth_options($auth_options) { - global $template, $user, $phpbb_container; + global $template, $phpbb_container; /* @var $phpbb_permissions \phpbb\permissions */ $phpbb_permissions = $phpbb_container->get('acl.permissions'); diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 26e7266409..fdac7c4d00 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -31,8 +31,8 @@ class acp_permissions function main($id, $mode) { - global $db, $user, $auth, $template, $cache, $phpbb_container, $request; - global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $db, $user, $auth, $template, $phpbb_container, $request; + global $config, $phpbb_root_path, $phpEx; if (!function_exists('user_get_id_name')) { @@ -167,8 +167,6 @@ class acp_permissions } // Define some common variables for every mode - $error = array(); - $permission_scope = (strpos($mode, '_global') !== false) ? 'global' : 'local'; // Showing introductionary page? @@ -692,8 +690,6 @@ class acp_permissions trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); } - $ug_id = $forum_id = 0; - // We loop through the auth settings defined in our submit list($ug_id, ) = each($psubmit); list($forum_id, ) = each($psubmit[$ug_id]); diff --git a/phpBB/includes/acp/acp_php_info.php b/phpBB/includes/acp/acp_php_info.php index 810a111edb..2a1afe80d4 100644 --- a/phpBB/includes/acp/acp_php_info.php +++ b/phpBB/includes/acp/acp_php_info.php @@ -25,8 +25,7 @@ class acp_php_info function main($id, $mode) { - global $db, $user, $auth, $template; - global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $template; if ($mode != 'info') { diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index 07620d0dcd..69672ebec0 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -33,8 +33,8 @@ class acp_profile function main($id, $mode) { - global $config, $db, $user, $auth, $template, $cache; - global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; + global $config, $db, $user, $template; + global $phpbb_root_path, $phpEx; global $request, $phpbb_container, $phpbb_log, $phpbb_dispatcher; if (!function_exists('generate_smilies')) @@ -55,7 +55,6 @@ class acp_profile $action = (isset($_POST['create'])) ? 'create' : $request->variable('action', ''); $error = array(); - $s_hidden_fields = ''; if (!$field_id && in_array($action, array('delete','activate', 'deactivate', 'move_up', 'move_down', 'edit'))) { @@ -776,7 +775,7 @@ class acp_profile */ function build_language_options(&$cp, $field_type, $action = 'create') { - global $user, $config, $db, $phpbb_container, $request; + global $user, $config, $db, $request; $default_lang_id = (!empty($this->edit_lang_id)) ? $this->edit_lang_id : $this->lang_defs['iso'][$config['default_lang']]; diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php index 2ea1e89df6..d37050869a 100644 --- a/phpBB/includes/acp/acp_prune.php +++ b/phpBB/includes/acp/acp_prune.php @@ -25,7 +25,7 @@ class acp_prune function main($id, $mode) { - global $user, $phpEx, $phpbb_admin_path, $phpbb_root_path; + global $user, $phpEx, $phpbb_root_path; $user->add_lang('acp/prune'); @@ -55,8 +55,7 @@ class acp_prune */ function prune_forums($id, $mode) { - global $db, $user, $auth, $template, $cache, $phpbb_log, $request; - global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $db, $user, $auth, $template, $phpbb_log, $request; $all_forums = $request->variable('all_forums', 0); $forum_id = $request->variable('f', array(0)); @@ -233,8 +232,8 @@ class acp_prune */ function prune_users($id, $mode) { - global $db, $user, $auth, $template, $cache, $phpbb_log, $request; - global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container; + global $db, $user, $auth, $template, $phpbb_log, $request; + global $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container; /** @var \phpbb\group\helper $group_helper */ $group_helper = $phpbb_container->get('group_helper'); @@ -441,7 +440,6 @@ class acp_prune } $key_match = array('lt' => '<', 'gt' => '>', 'eq' => '='); - $sort_by_types = array('username', 'user_email', 'user_posts', 'user_regdate', 'user_lastvisit'); $where_sql = ''; $where_sql .= ($username) ? ' AND username_clean ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), utf8_clean_string($username))) : ''; diff --git a/phpBB/includes/acp/acp_ranks.php b/phpBB/includes/acp/acp_ranks.php index 2921d6500b..4d2b64d74c 100644 --- a/phpBB/includes/acp/acp_ranks.php +++ b/phpBB/includes/acp/acp_ranks.php @@ -25,8 +25,8 @@ class acp_ranks function main($id, $mode) { - global $db, $user, $auth, $template, $cache, $request, $phpbb_dispatcher; - global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_log; + global $db, $user, $template, $cache, $request, $phpbb_dispatcher; + global $config, $phpbb_root_path, $phpbb_admin_path, $phpbb_log; $user->add_lang('acp/posting'); @@ -162,7 +162,7 @@ class acp_ranks case 'edit': case 'add': - $data = $ranks = $existing_imgs = array(); + $ranks = $existing_imgs = array(); $sql = 'SELECT * FROM ' . RANKS_TABLE . ' diff --git a/phpBB/includes/acp/acp_reasons.php b/phpBB/includes/acp/acp_reasons.php index 56f0296423..0d221bba3c 100644 --- a/phpBB/includes/acp/acp_reasons.php +++ b/phpBB/includes/acp/acp_reasons.php @@ -25,8 +25,7 @@ class acp_reasons function main($id, $mode) { - global $db, $user, $auth, $template, $cache; - global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $db, $user, $template; global $request, $phpbb_log; $user->add_lang(array('mcp', 'acp/posting')); diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php index 25fc1ed8dc..1f0e8ef539 100644 --- a/phpBB/includes/acp/acp_search.php +++ b/phpBB/includes/acp/acp_search.php @@ -50,8 +50,8 @@ class acp_search function settings($id, $mode) { - global $db, $user, $auth, $template, $cache, $phpbb_log, $request; - global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $user, $template, $phpbb_log, $request; + global $config, $phpbb_admin_path, $phpEx; $submit = (isset($_POST['submit'])) ? true : false; @@ -232,8 +232,8 @@ class acp_search function index($id, $mode) { - global $db, $user, $auth, $template, $cache, $phpbb_log, $request; - global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $db, $user, $template, $phpbb_log, $request; + global $config, $phpbb_admin_path, $phpEx; $action = $request->variable('action', ''); $this->state = explode(',', $config['search_indexing_state']); @@ -551,7 +551,7 @@ class acp_search function get_search_types() { - global $phpbb_root_path, $phpEx, $phpbb_extension_manager; + global $phpbb_extension_manager; $finder = $phpbb_extension_manager->get_finder(); diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 0cd6633710..7878cbc8e9 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -201,7 +201,6 @@ class acp_styles $messages = array(); $installed_names = array(); $installed_dirs = array(); - $last_installed = false; foreach ($dirs as $dir) { if (in_array($dir, $this->reserved_style_names)) @@ -224,7 +223,6 @@ class acp_styles $style['style_id'] = $this->install_style($style); $style['_installed'] = true; $found = true; - $last_installed = $style['style_id']; $installed_names[] = $style['style_name']; $installed_dirs[] = $style['style_path']; $messages[] = sprintf($this->user->lang['STYLE_INSTALLED'], htmlspecialchars($style['style_name'])); diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 204c838c0f..2bec4385c3 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -31,8 +31,8 @@ class acp_users function main($id, $mode) { - global $config, $db, $user, $auth, $template, $cache; - global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads; + global $config, $db, $user, $auth, $template; + global $phpbb_root_path, $phpbb_admin_path, $phpEx; global $phpbb_dispatcher, $request; global $phpbb_container, $phpbb_log; @@ -298,13 +298,11 @@ class acp_users case 'banuser': $ban[] = $user_row['username']; $reason = 'USER_ADMIN_BAN_NAME_REASON'; - $log = 'LOG_USER_BAN_USER'; break; case 'banemail': $ban[] = $user_row['user_email']; $reason = 'USER_ADMIN_BAN_EMAIL_REASON'; - $log = 'LOG_USER_BAN_EMAIL'; break; case 'banip': @@ -322,7 +320,6 @@ class acp_users $db->sql_freeresult($result); $reason = 'USER_ADMIN_BAN_IP_REASON'; - $log = 'LOG_USER_BAN_IP'; break; } @@ -1271,17 +1268,10 @@ class acp_users $user->add_lang('mcp'); // Set up general vars - $start = $request->variable('start', 0); $deletemark = (isset($_POST['delmarked'])) ? true : false; $deleteall = (isset($_POST['delall'])) ? true : false; $confirm = (isset($_POST['confirm'])) ? true : false; $marked = $request->variable('mark', array(0)); - $message = $request->variable('message', '', true); - - // Sort keys - $sort_days = $request->variable('st', 0); - $sort_key = $request->variable('sk', 't'); - $sort_dir = $request->variable('sd', 'd'); // Delete entries if requested and able if ($deletemark || $deleteall || $confirm) @@ -1546,7 +1536,6 @@ class acp_users $selected = ($i == $data['bday_month']) ? ' selected="selected"' : ''; $s_birthday_month_options .= "<option value=\"$i\"$selected>$i</option>"; } - $s_birthday_year_options = ''; $now = getdate(); $s_birthday_year_options = '<option value="0"' . ((!$data['bday_year']) ? ' selected="selected"' : '') . '>--</option>'; @@ -2296,10 +2285,6 @@ class acp_users trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); } } - else - { - $founder_manage = 0; - } switch ($action) { diff --git a/phpBB/includes/acp/acp_words.php b/phpBB/includes/acp/acp_words.php index ea8d47a109..e5eeb7ab07 100644 --- a/phpBB/includes/acp/acp_words.php +++ b/phpBB/includes/acp/acp_words.php @@ -28,8 +28,7 @@ class acp_words function main($id, $mode) { - global $db, $user, $auth, $template, $cache, $phpbb_log, $request, $phpbb_container; - global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $db, $user, $template, $cache, $phpbb_log, $request, $phpbb_container; $user->add_lang('acp/posting'); diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index 027be03a00..11478842d7 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -266,7 +266,7 @@ class auth_admin extends \phpbb\auth\auth */ function display_mask($mode, $permission_type, &$hold_ary, $user_mode = 'user', $local = false, $group_display = true) { - global $template, $user, $db, $phpbb_root_path, $phpEx, $phpbb_container; + global $template, $user, $db, $phpbb_container; /* @var $phpbb_permissions \phpbb\permissions */ $phpbb_permissions = $phpbb_container->get('acl.permissions'); @@ -607,7 +607,7 @@ class auth_admin extends \phpbb\auth\auth */ function display_role_mask(&$hold_ary) { - global $db, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $db, $template, $user, $phpbb_root_path, $phpEx; global $phpbb_container; if (!sizeof($hold_ary)) @@ -1106,7 +1106,7 @@ class auth_admin extends \phpbb\auth\auth */ function assign_cat_array(&$category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $s_view, $show_trace = false) { - global $template, $user, $phpbb_admin_path, $phpEx, $phpbb_container; + global $template, $phpbb_admin_path, $phpEx, $phpbb_container; /* @var $phpbb_permissions \phpbb\permissions */ $phpbb_permissions = $phpbb_container->get('acl.permissions'); @@ -1195,7 +1195,7 @@ class auth_admin extends \phpbb\auth\auth */ function build_permission_array(&$permission_row, &$content_array, &$categories, $key_sort_array) { - global $user, $phpbb_container; + global $phpbb_container; /* @var $phpbb_permissions \phpbb\permissions */ $phpbb_permissions = $phpbb_container->get('acl.permissions'); diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index 41d4ec40fe..eb6133d013 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -140,7 +140,7 @@ class bbcode */ function bbcode_cache_init() { - global $phpbb_root_path, $phpEx, $config, $user, $phpbb_dispatcher, $phpbb_extension_manager, $phpbb_path_helper, $phpbb_container, $phpbb_filesystem; + global $user, $phpbb_dispatcher, $phpbb_extension_manager, $phpbb_container, $phpbb_filesystem; if (empty($this->template_filename)) { diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 2a891bcbac..38879caf5f 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -955,7 +955,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ */ function get_topic_tracking($forum_id, $topic_ids, &$rowset, $forum_mark_time, $global_announce_list = false) { - global $config, $user; + global $user; $last_read = array(); @@ -1260,7 +1260,7 @@ function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $s */ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_time = false, $mark_time_forum = false) { - global $db, $tracking_topics, $user, $config, $auth, $request, $phpbb_container; + global $db, $tracking_topics, $user, $config, $request, $phpbb_container; // Determine the users last forum mark time if not given. if ($mark_time_forum === false) @@ -1318,8 +1318,6 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti else if ($config['load_anon_lastread'] || $user->data['is_registered']) { // Get information from cookie - $row = false; - if (!isset($tracking_topics['tf'][$forum_id])) { // We do not need to mark read, this happened before. Therefore setting this to true @@ -1719,9 +1717,7 @@ function generate_board_url($without_script_path = false) */ function redirect($url, $return = false, $disable_cd_check = false) { - global $db, $cache, $config, $user, $phpbb_root_path, $phpbb_filesystem, $phpbb_path_helper, $phpEx, $phpbb_dispatcher; - - $failover_flag = false; + global $user, $phpbb_path_helper, $phpbb_dispatcher; if (!$user->is_setup()) { @@ -2241,7 +2237,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo */ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = false, $s_display = true) { - global $db, $user, $template, $auth, $phpEx, $phpbb_root_path, $config; + global $user, $template, $auth, $phpEx, $phpbb_root_path, $config; global $request, $phpbb_container, $phpbb_dispatcher, $phpbb_log; $err = ''; @@ -3213,7 +3209,7 @@ function phpbb_checkdnsrr($host, $type = 'MX') function msg_handler($errno, $msg_text, $errfile, $errline) { global $cache, $db, $auth, $template, $config, $user, $request; - global $phpEx, $phpbb_root_path, $msg_title, $msg_long_text, $phpbb_log; + global $phpbb_root_path, $msg_title, $msg_long_text, $phpbb_log; // Do not display notices if we suppress them via @ if (error_reporting() == 0 && $errno != E_USER_ERROR && $errno != E_USER_WARNING && $errno != E_USER_NOTICE) @@ -3545,7 +3541,7 @@ function obtain_guest_count($item_id = 0, $item = 'forum') */ function obtain_users_online($item_id = 0, $item = 'forum') { - global $db, $config, $user; + global $db, $config; $reading_sql = ''; if ($item_id !== 0) @@ -3611,7 +3607,6 @@ function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum' { global $config, $db, $user, $auth, $phpbb_dispatcher; - $guests_online = $hidden_online = $l_online_users = $online_userlist = $visible_online = ''; $user_online_link = $rowset = array(); // Need caps version of $item for language-strings $item_caps = strtoupper($item); @@ -4008,8 +4003,7 @@ function phpbb_get_group_avatar($user_row, $alt = 'GROUP_AVATAR', $ignore_config */ function phpbb_get_avatar($row, $alt, $ignore_config = false, $lazy = false) { - global $user, $config, $cache, $phpbb_root_path, $phpEx; - global $request; + global $user, $config; global $phpbb_container, $phpbb_dispatcher; if (!$config['allow_avatar'] && !$ignore_config) @@ -4560,7 +4554,7 @@ function phpbb_generate_debug_output(\phpbb\db\driver\driver_interface $db, \php */ function page_footer($run_cron = true, $display_template = true, $exit_handler = true) { - global $db, $config, $template, $user, $auth, $cache, $starttime, $phpbb_root_path, $phpEx; + global $db, $config, $template, $user, $auth, $cache, $phpEx; global $request, $phpbb_dispatcher, $phpbb_admin_path; // A listener can set this variable to `true` when it overrides this function @@ -4701,7 +4695,7 @@ function garbage_collection() */ function exit_handler() { - global $phpbb_hook, $config; + global $phpbb_hook; if (!empty($phpbb_hook) && $phpbb_hook->call_hook(__FUNCTION__)) { diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index 803e4f5e54..d710d984b7 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -24,7 +24,7 @@ if (!defined('IN_PHPBB')) */ function adm_page_header($page_title) { - global $config, $db, $user, $template; + global $config, $user, $template; global $phpbb_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID; global $phpbb_dispatcher, $phpbb_container; @@ -142,8 +142,8 @@ function adm_page_header($page_title) */ function adm_page_footer($copyright_html = true) { - global $db, $config, $template, $user, $auth, $cache; - global $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $db, $config, $template, $user, $auth; + global $phpbb_root_path; global $request, $phpbb_dispatcher; // A listener can set this variable to `true` when it overrides this function @@ -275,7 +275,7 @@ function build_cfg_template($tpl_type, $key, &$new_ary, $config_key, $vars) break; case 'number': - $min = $max = $maxlength = ''; + $max = $maxlength = ''; $min = ( isset($tpl_type[1]) ) ? (int) $tpl_type[1] : false; if ( isset($tpl_type[2]) ) { @@ -287,7 +287,7 @@ function build_cfg_template($tpl_type, $key, &$new_ary, $config_key, $vars) break; case 'dimension': - $min = $max = $maxlength = $size = ''; + $max = $maxlength = $size = ''; $min = (int) $tpl_type[1]; @@ -323,8 +323,6 @@ function build_cfg_template($tpl_type, $key, &$new_ary, $config_key, $vars) case 'select': case 'custom': - $return = ''; - if (isset($vars['method'])) { $call = array($module->module, $vars['method']); @@ -654,8 +652,6 @@ function validate_range($value_ary, &$error) foreach ($value_ary as $value) { $column = explode(':', $value['column_type']); - $max = $min = 0; - $type = 0; if (!isset($column_types[$column[0]])) { continue; diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 459d61a17a..1c7e68d358 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -65,7 +65,7 @@ function recalc_nested_sets(&$new_id, $pkey, $table, $parent_id = 0, $where = ar */ function make_forum_select($select_id = false, $ignore_id = false, $ignore_acl = false, $ignore_nonpost = false, $ignore_emptycat = true, $only_acl_post = false, $return_array = false) { - global $db, $user, $auth; + global $db, $auth; // This query is identical to the jumpbox one $sql = 'SELECT forum_id, forum_name, parent_id, forum_type, forum_flags, forum_options, left_id, right_id @@ -2009,7 +2009,6 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, AND u.user_id = p.poster_id'; $result = $db->sql_query($sql); - $post_ids = array(); while ($row = $db->sql_fetchrow($result)) { $topic_id = intval($row['topic_id']); @@ -2082,7 +2081,6 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, AND u.user_id = p.poster_id'; $result = $db->sql_query($sql); - $post_ids = array(); while ($row = $db->sql_fetchrow($result)) { $topic_id = (int) $row['topic_id']; @@ -2377,7 +2375,7 @@ function phpbb_cache_moderators($db, $cache, $auth) } // We add moderators who have forum moderator permissions without an explicit ACL_NEVER setting - $hold_ary = $ug_id_ary = $sql_ary = array(); + $sql_ary = array(); // Grab all users having moderative options... $hold_ary = $auth->acl_user_raw_data(false, 'm_%', false); diff --git a/phpBB/includes/functions_compress.php b/phpBB/includes/functions_compress.php index e768a0f47b..910708f502 100644 --- a/phpBB/includes/functions_compress.php +++ b/phpBB/includes/functions_compress.php @@ -56,7 +56,6 @@ class compress // Clean up path, add closing / if not present $src_path = ($src_path && substr($src_path, -1) != '/') ? $src_path . '/' : $src_path; - $filelist = array(); $filelist = filelist("$phpbb_root_path$src", '', '*'); krsort($filelist); diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 997cafdea4..df25451266 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -651,7 +651,7 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb */ function generate_text_for_edit($text, $uid, $flags) { - global $phpbb_root_path, $phpEx, $phpbb_dispatcher; + global $phpbb_dispatcher; /** * Use this event to modify the text before it is decoded for editing @@ -1056,7 +1056,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count_a // Some basics... $attachment['extension'] = strtolower(trim($attachment['extension'])); $filename = $phpbb_root_path . $config['upload_path'] . '/' . utf8_basename($attachment['physical_filename']); - $thumbnail_filename = $phpbb_root_path . $config['upload_path'] . '/thumb_' . utf8_basename($attachment['physical_filename']); $upload_icon = ''; @@ -1098,7 +1097,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count_a if (!$denied) { - $l_downloaded_viewed = $download_link = ''; $display_cat = $extensions[$attachment['extension']]['display_cat']; if ($display_cat == ATTACHMENT_CATEGORY_IMAGE) @@ -1316,8 +1314,6 @@ function extension_allowed($forum_id, $extension, &$extensions) */ function truncate_string($string, $max_length = 60, $max_store_length = 255, $allow_reply = false, $append = '') { - $chars = array(); - $strip_reply = false; $stripped = false; if ($allow_reply && strpos($string, 'Re: ') === 0) diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index 0a25ae8c36..3575768782 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -423,7 +423,7 @@ function remote_avatar_dims() function import_avatar_gallery($gallery_name = '', $subdirs_as_galleries = false) { - global $config, $convert, $phpbb_root_path, $user; + global $config, $convert, $user; $relative_path = empty($convert->convertor['source_path_absolute']); @@ -492,7 +492,7 @@ function import_avatar_gallery($gallery_name = '', $subdirs_as_galleries = false function import_attachment_files($category_name = '') { - global $config, $convert, $phpbb_root_path, $db, $user; + global $config, $convert, $db, $user; $sql = 'SELECT config_value AS upload_path FROM ' . CONFIG_TABLE . " @@ -590,7 +590,7 @@ function import_attachment($source, $use_target = false) return ''; } - global $convert, $phpbb_root_path, $config, $user; + global $convert, $config, $user; // check for trailing slash if (rtrim($convert->convertor['upload_path'], '/') === '') @@ -632,7 +632,7 @@ function import_rank($source, $use_target = false) return ''; } - global $convert, $phpbb_root_path, $config, $user; + global $convert, $user; if (!isset($convert->convertor['ranks_path'])) { @@ -650,7 +650,7 @@ function import_smiley($source, $use_target = false) return ''; } - global $convert, $phpbb_root_path, $config, $user; + global $convert, $user; // check for trailing slash if (rtrim($convert->convertor['smilies_path'], '/') === '') @@ -671,7 +671,7 @@ function import_avatar($source, $use_target = false, $user_id = false) return; } - global $convert, $phpbb_root_path, $config, $user; + global $convert, $config, $user; // check for trailing slash if (rtrim($convert->convertor['avatar_path'], '/') === '') @@ -684,7 +684,7 @@ function import_avatar($source, $use_target = false, $user_id = false) $use_target = $config['avatar_salt'] . '_' . $user_id . '.' . substr(strrchr($source, '.'), 1); } - $result = _import_check('avatar_path', $source, $use_target); + _import_check('avatar_path', $source, $use_target); return ((!empty($user_id)) ? $user_id : $use_target) . '.' . substr(strrchr($source, '.'), 1); } @@ -750,7 +750,7 @@ function get_smiley_dim($source, $axis) return $smiley_cache[$source][$axis]; } - global $convert, $phpbb_root_path, $config, $user; + global $convert, $user; $orig_source = $source; @@ -858,14 +858,12 @@ function get_upload_avatar_dim($source, $axis) return $cachedims[$axis]; } - $orig_source = $source; - if (substr($source, 0, 7) == 'upload:') { $source = substr($source, 7); } - global $convert, $phpbb_root_path, $config, $user; + global $convert, $user; if (!isset($convert->convertor['avatar_path'])) { @@ -907,7 +905,7 @@ function get_gallery_avatar_dim($source, $axis) return $avatar_cache[$source][$axis]; } - global $convert, $phpbb_root_path, $config, $user; + global $convert, $user; $orig_source = $source; @@ -1122,7 +1120,7 @@ function words_unique(&$words) */ function add_user_group($group_id, $user_id, $group_leader = false) { - global $convert, $phpbb_root_path, $config, $user, $db; + global $db; $sql = 'INSERT INTO ' . USER_GROUP_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'group_id' => $group_id, @@ -1142,7 +1140,7 @@ function add_user_group($group_id, $user_id, $group_leader = false) */ function user_group_auth($group, $select_query, $use_src_db) { - global $convert, $phpbb_root_path, $config, $user, $db, $src_db, $same_db; + global $convert, $user, $db, $src_db, $same_db; if (!in_array($group, array('guests', 'registered', 'registered_coppa', 'global_moderators', 'administrators', 'bots'))) { @@ -1198,7 +1196,7 @@ function get_config() return $convert_config; } - global $src_db, $same_db, $phpbb_root_path, $config; + global $src_db, $same_db; global $convert; if ($convert->config_schema['table_format'] != 'file') @@ -1277,7 +1275,7 @@ function get_config() */ function restore_config($schema) { - global $db, $config; + global $config; $convert_config = get_config(); @@ -1322,7 +1320,7 @@ function restore_config($schema) */ function update_folder_pm_count() { - global $db, $convert, $user; + global $db; $sql = 'SELECT user_id, folder_id, COUNT(msg_id) as num_messages FROM ' . PRIVMSGS_TO_TABLE . ' @@ -1381,7 +1379,7 @@ function extract_variables_from_file($_filename) function get_path($src_path, $src_url, $test_file) { - global $config, $phpbb_root_path, $phpEx; + global $phpbb_root_path, $phpEx; $board_config = get_config(); @@ -1492,7 +1490,7 @@ function compare_table($tables, $tablename, &$prefixes) */ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting = ACL_NO) { - global $db, $convert, $user, $config; + global $db; static $acl_option_ids, $group_ids; if (($ug_type == 'group' || $ug_type == 'group_role') && is_string($ug_id)) @@ -2039,7 +2037,7 @@ function update_dynamic_config() */ function update_topics_posted() { - global $db, $config; + global $db; switch ($db->get_sql_layer()) { @@ -2180,7 +2178,7 @@ function fix_empty_primary_groups() */ function remove_invalid_users() { - global $convert, $db, $phpEx, $phpbb_root_path; + global $db, $phpEx, $phpbb_root_path; // username_clean is UNIQUE $sql = 'SELECT user_id @@ -2316,7 +2314,7 @@ function convert_bbcode($message, $convert_size = true, $extended_bbcodes = fals function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $source_relative_path = true) { - global $convert, $phpbb_root_path, $config, $user, $db, $phpbb_filesystem; + global $convert, $phpbb_root_path, $user, $phpbb_filesystem; /** @var \phpbb\filesystem\filesystem_interface $filesystem */ $filesystem = $phpbb_filesystem; @@ -2373,7 +2371,7 @@ function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $sour function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_failure = true, $source_relative_path = true) { - global $convert, $phpbb_root_path, $config, $user, $db, $phpbb_filesystem; + global $convert, $phpbb_root_path, $config, $user, $phpbb_filesystem; /** @var \phpbb\filesystem\filesystem_interface $filesystem */ $filesystem = $phpbb_filesystem; @@ -2485,7 +2483,7 @@ function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_ function relative_base($path, $is_relative = true, $line = false, $file = false) { - global $convert, $phpbb_root_path, $config, $user, $db; + global $convert, $user; if (!$is_relative) { diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index e3412c9875..afda10ebee 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -30,7 +30,6 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $forum_rows = $subforums = $forum_ids = $forum_ids_moderator = $forum_moderators = $active_forum_ary = array(); $parent_id = $visible_forums = 0; - $sql_from = ''; // Mark forums read? $mark_read = $request->variable('mark', ''); @@ -732,7 +731,7 @@ function generate_forum_rules(&$forum_data) return; } - global $template, $phpbb_root_path, $phpEx; + global $template; if ($forum_data['forum_rules']) { @@ -752,7 +751,7 @@ function generate_forum_rules(&$forum_data) */ function generate_forum_nav(&$forum_data_ary) { - global $db, $user, $template, $auth, $config; + global $template, $auth, $config; global $phpEx, $phpbb_root_path, $phpbb_dispatcher; if (!$auth->acl_get('f_list', $forum_data_ary['forum_id'])) @@ -760,7 +759,7 @@ function generate_forum_nav(&$forum_data_ary) return; } - $navlinks = $navlinks_parents = $forum_template_data = array(); + $navlinks_parents = $forum_template_data = array(); // Get forum parents $forum_parents = get_forum_parents($forum_data_ary); @@ -887,7 +886,7 @@ function get_forum_parents(&$forum_data) */ function get_moderators(&$forum_moderators, $forum_id = false) { - global $config, $template, $db, $phpbb_root_path, $phpEx, $user, $auth; + global $db, $phpbb_root_path, $phpEx, $user, $auth; global $phpbb_container; $forum_id_ary = array(); @@ -1003,8 +1002,6 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold { global $user, $config; - $folder = $folder_new = ''; - if ($topic_row['topic_status'] == ITEM_MOVED) { $topic_type = $user->lang['VIEW_TOPIC_MOVED']; @@ -1295,7 +1292,7 @@ function display_user_activity(&$userdata_ary) */ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $notify_status = 'unset', $start = 0, $item_title = '') { - global $template, $db, $user, $phpEx, $start, $phpbb_root_path; + global $db, $user, $phpEx, $start, $phpbb_root_path; global $request; $table_sql = ($mode == 'forum') ? FORUMS_WATCH_TABLE : TOPICS_WATCH_TABLE; diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php index 6aabfdf641..916655e77c 100644 --- a/phpBB/includes/functions_download.php +++ b/phpBB/includes/functions_download.php @@ -123,7 +123,7 @@ function wrap_img_in_html($src, $title) */ function send_file_to_browser($attachment, $upload_dir, $category) { - global $user, $db, $config, $phpbb_root_path, $request; + global $user, $db, $phpbb_root_path, $request; $filename = $phpbb_root_path . $upload_dir . '/' . $attachment['physical_filename']; diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 810f2c0584..0aee9dd3cf 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -206,7 +206,7 @@ class messenger */ function template($template_file, $template_lang = '', $template_path = '') { - global $config, $phpbb_root_path, $phpEx, $user, $phpbb_extension_manager; + global $config, $phpbb_root_path, $user; $this->setup_template(); @@ -349,7 +349,7 @@ class messenger */ function error($type, $msg) { - global $user, $phpEx, $phpbb_root_path, $config, $request, $phpbb_log; + global $user, $config, $request, $phpbb_log; // Session doesn't exist, create it if (!isset($user->session_id) || $user->session_id === '') @@ -359,7 +359,6 @@ class messenger $calling_page = htmlspecialchars_decode($request->server('PHP_SELF')); - $message = ''; switch ($type) { case 'EMAIL': @@ -453,7 +452,7 @@ class messenger */ function msg_email() { - global $config, $user; + global $config; if (empty($config['email_enable'])) { @@ -551,7 +550,7 @@ class messenger */ function msg_jabber() { - global $config, $db, $user, $phpbb_root_path, $phpEx; + global $config, $user, $phpbb_root_path, $phpEx; if (empty($config['jab_enable']) || empty($config['jab_host']) || empty($config['jab_username']) || empty($config['jab_password'])) { @@ -623,7 +622,7 @@ class messenger */ protected function setup_template() { - global $config, $phpbb_path_helper, $user, $phpbb_extension_manager, $phpbb_container, $phpbb_filesystem; + global $phpbb_extension_manager, $phpbb_container, $phpbb_filesystem; if ($this->template instanceof \phpbb\template\template) { @@ -715,7 +714,7 @@ class queue */ function process() { - global $db, $config, $phpEx, $phpbb_root_path, $user; + global $config, $phpEx, $phpbb_root_path, $user; $lock = new \phpbb\lock\flock($this->cache_file); $lock->acquire(); @@ -1258,8 +1257,6 @@ class smtp_class { global $user; - $err_msg = ''; - // Here we try to determine the *real* hostname (reverse DNS entry preferrably) $local_host = $user->host; @@ -1294,7 +1291,7 @@ class smtp_class $this->server_send("QUIT"); fclose($this->socket); - $result = $this->pop_before_smtp($hostname, $username, $password); + $this->pop_before_smtp($hostname, $username, $password); $username = $password = $default_auth_method = ''; // We need to close the previous session, else the server is not @@ -1736,7 +1733,7 @@ function mail_encode($str, $eol = "\r\n") */ function phpbb_mail($to, $subject, $msg, $headers, $eol, &$err_msg) { - global $config, $phpbb_root_path, $phpEx; + global $phpbb_root_path, $phpEx; // We use the EOL character for the OS here because the PHP mail function does not correctly transform line endings. On Windows SMTP is used (SMTP is \r\n), on UNIX a command is used... // Reference: http://bugs.php.net/bug.php?id=15841 diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index 144e6b4e7c..7a1991d69a 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -82,8 +82,8 @@ class p_master */ function list_modules($p_class) { - global $auth, $db, $user, $cache; - global $config, $phpbb_root_path, $phpEx, $phpbb_dispatcher; + global $db, $user, $cache; + global $phpbb_dispatcher; // Sanitise for future path use, it's escaped as appropriate for queries $this->p_class = str_replace(array('.', '/', '\\'), '', basename($p_class)); @@ -729,8 +729,6 @@ class p_master */ function get_parents($parent_id, $left_id, $right_id, &$all_parents) { - global $db; - $parents = array(); if ($parent_id > 0) @@ -822,7 +820,7 @@ class p_master // Make sure the module_url has a question mark set, effectively determining the delimiter to use $delim = (strpos($module_url, '?') === false) ? '?' : '&'; - $current_padding = $current_depth = 0; + $current_depth = 0; $linear_offset = 'l_block1'; $tabular_offset = 't_block2'; diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 66140a5278..56d2408e88 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -333,7 +333,7 @@ function posting_gen_topic_icons($mode, $icon_id) */ function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL) { - global $auth, $user, $template, $topic_type; + global $auth, $user, $template; $toggle = false; @@ -833,7 +833,7 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $ms foreach ($draft_rows as $draft) { $link_topic = $link_forum = $link_pm = false; - $insert_url = $view_url = $title = ''; + $view_url = $title = ''; if (isset($topic_rows[$draft['topic_id']]) && ( @@ -886,7 +886,7 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $ms */ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id = 0, $show_quote_button = true) { - global $user, $auth, $db, $template, $cache; + global $user, $auth, $db, $template; global $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher; /* @var $phpbb_content_visibility \phpbb\content_visibility */ @@ -959,11 +959,9 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id $db->sql_freeresult($result); // Grab extensions - $extensions = $attachments = array(); + $attachments = array(); if ($has_attachments && $auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id)) { - $extensions = $cache->obtain_attach_extensions($forum_id); - // Get attachments... $sql = 'SELECT * FROM ' . ATTACHMENTS_TABLE . ' @@ -1101,7 +1099,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id */ function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $softdelete_reason = '') { - global $db, $user, $auth, $phpbb_container; + global $db, $user, $phpbb_container; global $config, $phpEx, $phpbb_root_path; // Specify our post mode @@ -1190,7 +1188,6 @@ function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $ if ($is_soft) { - $topic_row = array(); $phpbb_content_visibility->set_topic_visibility(ITEM_DELETED, $topic_id, $forum_id, $user->data['user_id'], time(), $softdelete_reason); } else @@ -1362,7 +1359,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $ */ function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data_ary, $update_message = true, $update_search_index = true) { - global $db, $auth, $user, $config, $phpEx, $template, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher, $phpbb_log, $request; + global $db, $auth, $user, $config, $phpEx, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher, $phpbb_log, $request; $poll = $poll_ary; $data = $data_ary; @@ -1589,7 +1586,6 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data break; } - $topic_row = array(); // And the topic ladies and gentlemen switch ($post_mode) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index f5cbb093d6..d92934e59e 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -226,7 +226,7 @@ function get_folder($user_id, $folder_id = false) */ function clean_sentbox($num_sentbox_messages) { - global $db, $user, $config; + global $db, $user; // Check Message Limit if ($user->data['message_limit'] && $num_sentbox_messages > $user->data['message_limit']) @@ -255,8 +255,6 @@ function clean_sentbox($num_sentbox_messages) */ function check_rule(&$rules, &$rule_row, &$message_row, $user_id) { - global $user, $config; - if (!isset($rules[$rule_row['rule_check']][$rule_row['rule_connection']])) { return false; @@ -335,7 +333,7 @@ function check_rule(&$rules, &$rule_row, &$message_row, $user_id) break; case ACTION_DELETE_MESSAGE: - global $db, $auth; + global $db; // Check for admins/mods - users are not allowed to remove those messages... // We do the check here to make sure the data we use is consistent @@ -546,7 +544,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) } // We place actions into arrays, to save queries. - $sql = $unread_ids = $delete_ids = $important_ids = array(); + $unread_ids = $delete_ids = $important_ids = array(); foreach ($action_ary as $msg_id => $msg_ary) { @@ -942,7 +940,6 @@ function handle_mark_actions($user_id, $mark_action) $msg_ids = $request->variable('marked_msg_id', array(0)); $cur_folder_id = $request->variable('cur_folder_id', PRIVMSGS_NO_BOX); - $confirm = (isset($_POST['confirm'])) ? true : false; if (!sizeof($msg_ids)) { @@ -1007,7 +1004,7 @@ function handle_mark_actions($user_id, $mark_action) */ function delete_pm($user_id, $msg_ids, $folder_id) { - global $db, $user, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher; + global $db, $user, $phpbb_container, $phpbb_dispatcher; $user_id = (int) $user_id; $folder_id = (int) $folder_id; @@ -1177,8 +1174,6 @@ function delete_pm($user_id, $msg_ids, $folder_id) */ function phpbb_delete_user_pms($user_id) { - global $db, $user, $phpbb_root_path, $phpEx; - $user_id = (int) $user_id; if (!$user_id) @@ -1198,7 +1193,7 @@ function phpbb_delete_user_pms($user_id) */ function phpbb_delete_users_pms($user_ids) { - global $db, $user, $phpbb_root_path, $phpEx, $phpbb_container; + global $db, $phpbb_container; $user_id_sql = $db->sql_in_set('user_id', $user_ids); $author_id_sql = $db->sql_in_set('author_id', $user_ids); @@ -1396,8 +1391,6 @@ function phpbb_delete_users_pms($user_ids) */ function rebuild_header($check_ary) { - global $db; - $address = array(); foreach ($check_ary as $check_type => $address_field) @@ -1577,7 +1570,7 @@ function write_pm_addresses($check_ary, $author_id, $plaintext = false) */ function get_folder_status($folder_id, $folder) { - global $db, $user, $config; + global $user; if (isset($folder[$folder_id])) { @@ -1610,7 +1603,7 @@ function get_folder_status($folder_id, $folder) */ function submit_pm($mode, $subject, &$data_ary, $put_in_outbox = true) { - global $db, $auth, $config, $phpEx, $template, $user, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher, $request; + global $db, $auth, $config, $user, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher, $request; // We do not handle erasing pms here if ($mode == 'delete') @@ -1764,8 +1757,6 @@ function submit_pm($mode, $subject, &$data_ary, $put_in_outbox = true) if (sizeof($sql_data)) { - $query = ''; - if ($mode == 'post' || $mode == 'reply' || $mode == 'quote' || $mode == 'quotepost' || $mode == 'forward') { $db->sql_query('INSERT INTO ' . PRIVMSGS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_data)); @@ -1966,7 +1957,7 @@ function submit_pm($mode, $subject, &$data_ary, $put_in_outbox = true) */ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode = false) { - global $db, $user, $config, $template, $phpbb_root_path, $phpEx, $auth; + global $db, $user, $template, $phpbb_root_path, $phpEx, $auth; // Select all receipts and the author from the pm we currently view, to only display their pm-history $sql = 'SELECT author_id, user_id diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php index 42fdee364c..0fc8a7eea5 100644 --- a/phpBB/includes/functions_transfer.php +++ b/phpBB/includes/functions_transfer.php @@ -406,9 +406,6 @@ class ftp extends transfer */ function _put($from_file, $to_file) { - // get the file extension - $file_extension = strtolower(substr(strrchr($to_file, '.'), 1)); - // We only use the BINARY file mode to cicumvent rewrite actions from ftp server (mostly linefeeds being replaced) $mode = FTP_BINARY; diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 2edc493500..e1c687551b 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -166,7 +166,7 @@ function user_update_name($old_name, $new_name) */ function user_add($user_row, $cp_data = false, $notifications_data = null) { - global $db, $user, $auth, $config, $phpbb_root_path, $phpEx; + global $db, $config; global $phpbb_dispatcher, $phpbb_container; if (empty($user_row['username']) || !isset($user_row['group_id']) || !isset($user_row['user_email']) || !isset($user_row['user_type'])) @@ -866,7 +866,7 @@ function user_active_flip($mode, $user_id_ary, $reason = INACTIVE_MANUAL) */ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reason, $ban_give_reason = '') { - global $db, $user, $auth, $cache, $phpbb_log; + global $db, $user, $cache, $phpbb_log; // Delete stale bans $sql = 'DELETE FROM ' . BANLIST_TABLE . ' @@ -1015,7 +1015,6 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas if ($ip_2_counter == 0 && $ip_2_end == 254) { $ip_2_counter = 256; - $ip_2_fragment = 256; $banlist_ary[] = "$ip_1_counter.*"; } @@ -1028,7 +1027,6 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas if ($ip_3_counter == 0 && $ip_3_end == 254) { $ip_3_counter = 256; - $ip_3_fragment = 256; $banlist_ary[] = "$ip_1_counter.$ip_2_counter.*"; } @@ -1041,7 +1039,6 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas if ($ip_4_counter == 0 && $ip_4_end == 254) { $ip_4_counter = 256; - $ip_4_fragment = 256; $banlist_ary[] = "$ip_1_counter.$ip_2_counter.$ip_3_counter.*"; } @@ -1292,7 +1289,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas */ function user_unban($mode, $ban) { - global $db, $user, $auth, $cache, $phpbb_log; + global $db, $user, $cache, $phpbb_log; // Delete stale bans $sql = 'DELETE FROM ' . BANLIST_TABLE . ' @@ -2141,7 +2138,7 @@ function phpbb_style_is_active($style_id) */ function avatar_delete($mode, $row, $clean_db = false) { - global $phpbb_root_path, $config, $db, $user; + global $phpbb_root_path, $config; // Check if the users avatar is actually *not* a group avatar if ($mode == 'user') @@ -2213,7 +2210,7 @@ function phpbb_avatar_explanation_string() */ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow_desc_bbcode = false, $allow_desc_urls = false, $allow_desc_smilies = false) { - global $phpbb_root_path, $config, $db, $user, $file_upload, $phpbb_container, $phpbb_log; + global $db, $user, $phpbb_container, $phpbb_log; /** @var \phpbb\group\helper $group_helper */ $group_helper = $phpbb_container->get('group_helper'); @@ -2325,8 +2322,6 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow // Setting the log message before we set the group id (if group gets added) $log = ($group_id) ? 'LOG_GROUP_UPDATED' : 'LOG_GROUP_CREATED'; - $query = ''; - if ($group_id) { $sql = 'SELECT user_id @@ -2508,7 +2503,7 @@ function group_correct_avatar($group_id, $old_entry) */ function avatar_remove_db($avatar_name) { - global $config, $db; + global $db; $sql = 'UPDATE ' . USERS_TABLE . " SET user_avatar = '', @@ -3012,7 +3007,7 @@ function remove_default_rank($group_id, $user_ids) */ function group_user_attributes($action, $group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $group_attributes = false) { - global $db, $auth, $user, $phpbb_root_path, $phpEx, $config, $phpbb_container, $phpbb_log; + global $db, $auth, $user, $phpbb_container, $phpbb_log; // We need both username and user_id info $result = user_get_id_name($user_id_ary, $username_ary); @@ -3159,7 +3154,7 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna */ function group_validate_groupname($group_id, $group_name) { - global $config, $db; + global $db; $group_name = utf8_clean_string($group_name); @@ -3356,7 +3351,7 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal */ function get_group_name($group_id) { - global $db, $user, $phpbb_container; + global $db, $phpbb_container; $sql = 'SELECT group_name, group_type FROM ' . GROUPS_TABLE . ' diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index 90a3db0949..dc4d59cc46 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -241,8 +241,6 @@ function mcp_forum_view($id, $mode, $action, $forum_info) foreach ($topic_list as $topic_id) { - $topic_title = ''; - $row_ary = &$topic_rows[$topic_id]; $replies = $phpbb_content_visibility->get_count('topic_posts', $row_ary, $forum_id) - 1; @@ -358,7 +356,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) */ function mcp_resync_topics($topic_ids) { - global $auth, $db, $template, $phpEx, $user, $phpbb_root_path, $phpbb_log, $request; + global $db, $user, $phpbb_log, $request; if (!sizeof($topic_ids)) { @@ -406,7 +404,7 @@ function mcp_resync_topics($topic_ids) */ function merge_topics($forum_id, $topic_ids, $to_topic_id) { - global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $phpbb_log, $request; + global $db, $template, $user, $phpEx, $phpbb_root_path, $phpbb_log, $request; if (!sizeof($topic_ids)) { @@ -479,7 +477,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id) 'redirect' => $redirect, 'topic_id_list' => $topic_ids) ); - $success_msg = $return_link = ''; + $return_link = ''; if (confirm_box(true)) { diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index 23a0604ccd..432b26ad11 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -24,7 +24,7 @@ if (!defined('IN_PHPBB')) */ function mcp_front_view($id, $mode, $action) { - global $phpEx, $phpbb_root_path, $config; + global $phpEx, $phpbb_root_path; global $template, $db, $user, $auth, $module; global $phpbb_dispatcher, $request; diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php index bf2d462801..fca0412321 100644 --- a/phpBB/includes/mcp/mcp_logs.php +++ b/phpBB/includes/mcp/mcp_logs.php @@ -36,7 +36,7 @@ class mcp_logs function main($id, $mode) { global $auth, $db, $user, $template, $request; - global $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_log; + global $config, $phpbb_container, $phpbb_log; $user->add_lang('acp/common'); diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index e2fb1e4afa..9702056d7b 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -35,8 +35,8 @@ class mcp_main function main($id, $mode) { - global $auth, $db, $user, $template, $action; - global $config, $phpbb_root_path, $phpEx, $request; + global $auth, $user, $action; + global $phpbb_root_path, $phpEx, $request; global $phpbb_dispatcher; $quickmod = ($mode == 'quickmod') ? true : false; @@ -262,7 +262,7 @@ class mcp_main */ function lock_unlock($action, $ids) { - global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_log, $phpbb_dispatcher; + global $user, $db, $request, $phpbb_log, $phpbb_dispatcher; if ($action == 'lock' || $action == 'unlock') { @@ -306,7 +306,6 @@ function lock_unlock($action, $ids) 'action' => $action, 'redirect' => $redirect) ); - $success_msg = ''; if (confirm_box(true)) { @@ -367,7 +366,7 @@ function lock_unlock($action, $ids) */ function change_topic_type($action, $topic_ids) { - global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_log; + global $user, $db, $request, $phpbb_log; switch ($action) { @@ -412,7 +411,6 @@ function change_topic_type($action, $topic_ids) 'action' => $action, 'redirect' => $redirect, ); - $success_msg = ''; if (confirm_box(true)) { @@ -729,7 +727,7 @@ function mcp_move_topic($topic_ids) */ function mcp_restore_topic($topic_ids) { - global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container, $phpbb_log; + global $user, $phpEx, $phpbb_root_path, $request, $phpbb_container, $phpbb_log; if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_approve'))) { @@ -877,7 +875,7 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = '' if (!$is_soft) { - $return = delete_topics('topic_id', $topic_ids); + delete_topics('topic_id', $topic_ids); } } else @@ -1346,8 +1344,6 @@ function mcp_fork_topic($topic_ids) if ($topic_row['poll_start']) { - $poll_rows = array(); - $sql = 'SELECT * FROM ' . POLL_OPTIONS_TABLE . " WHERE topic_id = $topic_id"; diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php index 502d4cb1e7..67f59bd618 100644 --- a/phpBB/includes/mcp/mcp_notes.php +++ b/phpBB/includes/mcp/mcp_notes.php @@ -35,8 +35,8 @@ class mcp_notes function main($id, $mode) { - global $auth, $db, $user, $template, $request; - global $config, $phpbb_root_path, $phpEx; + global $user, $template, $request; + global $phpbb_root_path, $phpEx; $action = $request->variable('action', array('' => '')); @@ -74,7 +74,7 @@ class mcp_notes */ function mcp_notes_user_view($action) { - global $phpEx, $phpbb_root_path, $config, $phpbb_log, $request; + global $config, $phpbb_log, $request; global $template, $db, $user, $auth, $phpbb_container; $user_id = $request->variable('u', 0); diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php index 6e1d594135..67a1a959e4 100644 --- a/phpBB/includes/mcp/mcp_pm_reports.php +++ b/phpBB/includes/mcp/mcp_pm_reports.php @@ -35,7 +35,7 @@ class mcp_pm_reports function main($id, $mode) { - global $auth, $db, $user, $template, $cache, $request; + global $auth, $db, $user, $template, $request; global $config, $phpbb_root_path, $phpEx, $action, $phpbb_container; include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index 33aebccb22..7fa6ef4fff 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -25,7 +25,7 @@ if (!defined('IN_PHPBB')) function mcp_post_details($id, $mode, $action) { global $phpEx, $phpbb_root_path, $config, $request; - global $template, $db, $user, $auth, $cache; + global $template, $db, $user, $auth; global $phpbb_dispatcher; $user->add_lang('posting'); @@ -128,7 +128,6 @@ function mcp_post_details($id, $mode, $action) $users_ary = $usernames_ary = array(); $attachments = $extensions = array(); $post_id = $post_info['post_id']; - $topic_tracking_info = array(); // Get topic tracking info if ($config['load_db_lastread']) @@ -150,8 +149,6 @@ function mcp_post_details($id, $mode, $action) if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id'])) { - $extensions = $cache->obtain_attach_extensions($post_info['forum_id']); - $sql = 'SELECT * FROM ' . ATTACHMENTS_TABLE . ' WHERE post_msg_id = ' . $post_id . ' diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 9fdd16e791..bf93593c74 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -35,7 +35,7 @@ class mcp_queue public function main($id, $mode) { - global $auth, $db, $user, $template, $cache, $request; + global $auth, $db, $user, $template, $request; global $config, $phpbb_root_path, $phpEx, $action, $phpbb_container; global $phpbb_dispatcher; @@ -195,7 +195,7 @@ class mcp_queue )); } - $extensions = $attachments = $topic_tracking_info = array(); + $attachments = $topic_tracking_info = array(); // Get topic tracking info if ($config['load_db_lastread']) @@ -217,8 +217,6 @@ class mcp_queue if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id'])) { - $extensions = $cache->obtain_attach_extensions($post_info['forum_id']); - $sql = 'SELECT * FROM ' . ATTACHMENTS_TABLE . ' WHERE post_msg_id = ' . $post_id . ' @@ -402,7 +400,6 @@ class mcp_queue trigger_error('NOT_MODERATOR'); } - $forum_info = $forum_info[$forum_id]; $forum_list = $forum_id; } @@ -417,7 +414,6 @@ class mcp_queue $sort_by_sql = $sort_order_sql = array(); phpbb_mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id); - $forum_topics = ($total == -1) ? $forum_info['forum_topics_approved'] : $total; $limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : ''; $forum_names = array(); @@ -621,7 +617,7 @@ class mcp_queue */ static public function approve_posts($action, $post_id_list, $id, $mode) { - global $db, $template, $user, $config, $request, $phpbb_container, $phpbb_dispatcher; + global $template, $user, $request, $phpbb_container, $phpbb_dispatcher; global $phpEx, $phpbb_root_path, $phpbb_log; if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve'))) @@ -631,7 +627,7 @@ class mcp_queue $redirect = $request->variable('redirect', build_url(array('quickmod'))); $redirect = reapply_sid($redirect); - $success_msg = $post_url = ''; + $post_url = ''; $approve_log = array(); $num_topics = 0; @@ -876,7 +872,7 @@ class mcp_queue */ static public function approve_topics($action, $topic_id_list, $id, $mode) { - global $db, $template, $user, $config, $phpbb_log; + global $db, $template, $user, $phpbb_log; global $phpEx, $phpbb_root_path, $request, $phpbb_container, $phpbb_dispatcher; if (!phpbb_check_ids($topic_id_list, TOPICS_TABLE, 'topic_id', array('m_approve'))) @@ -1073,7 +1069,7 @@ class mcp_queue */ static public function disapprove_posts($post_id_list, $id, $mode) { - global $db, $template, $user, $config, $phpbb_container, $phpbb_dispatcher; + global $db, $template, $user, $phpbb_container, $phpbb_dispatcher; global $phpEx, $phpbb_root_path, $request, $phpbb_log; if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve'))) @@ -1085,7 +1081,7 @@ class mcp_queue $redirect = reapply_sid($redirect); $reason = $request->variable('reason', '', true); $reason_id = $request->variable('reason_id', 0); - $success_msg = $additional_msg = ''; + $additional_msg = ''; $s_hidden_fields = build_hidden_fields(array( 'i' => $id, @@ -1143,7 +1139,7 @@ class mcp_queue if (confirm_box(true)) { - $disapprove_log = $disapprove_log_topics = $disapprove_log_posts = array(); + $disapprove_log_topics = $disapprove_log_posts = array(); $topic_posts_unapproved = $post_disapprove_list = $topic_information = array(); // Build a list of posts to be disapproved and get the related topics real replies count diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index 45265c89e7..48d0e8d890 100644 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -35,7 +35,7 @@ class mcp_reports function main($id, $mode) { - global $auth, $db, $user, $template, $cache, $request; + global $auth, $db, $user, $template, $request; global $config, $phpbb_root_path, $phpEx, $action, $phpbb_container, $phpbb_dispatcher; include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); @@ -182,7 +182,7 @@ class mcp_reports )); } - $topic_tracking_info = $extensions = $attachments = array(); + $attachments = array(); // Get topic tracking info if ($config['load_db_lastread']) { @@ -351,8 +351,6 @@ class mcp_reports trigger_error('NOT_MODERATOR'); } - $global_id = $forum_list[0]; - $sql = 'SELECT SUM(forum_topics_approved) as sum_forum_topics FROM ' . FORUMS_TABLE . ' WHERE ' . $db->sql_in_set('forum_id', $forum_list); @@ -369,7 +367,6 @@ class mcp_reports trigger_error('NOT_MODERATOR'); } - $forum_info = $forum_info[$forum_id]; $forum_list = array($forum_id); } @@ -391,7 +388,6 @@ class mcp_reports $sort_by_sql = $sort_order_sql = array(); phpbb_mcp_sorting($mode, $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id); - $forum_topics = ($total == -1) ? $forum_info['forum_topics_approved'] : $total; $limit_time_sql = ($sort_days) ? 'AND r.report_time >= ' . (time() - ($sort_days * 86400)) : ''; if ($mode == 'reports') @@ -460,7 +456,6 @@ class mcp_reports ORDER BY ' . $sort_order_sql; $result = $db->sql_query($sql); - $report_data = $rowset = array(); while ($row = $db->sql_fetchrow($result)) { $template->assign_block_vars('postrow', array( @@ -522,7 +517,7 @@ class mcp_reports */ function close_report($report_id_list, $mode, $action, $pm = false) { - global $db, $template, $user, $config, $auth, $phpbb_log, $request; + global $db, $user, $auth, $phpbb_log, $request; global $phpEx, $phpbb_root_path, $phpbb_container; $pm_where = ($pm) ? ' AND r.post_id = 0 ' : ' AND r.pm_id = 0 '; diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 70794312f4..ba86484040 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -25,7 +25,7 @@ if (!defined('IN_PHPBB')) function mcp_topic_view($id, $mode, $action) { global $phpEx, $phpbb_root_path, $config, $request; - global $template, $db, $user, $auth, $cache, $phpbb_container, $phpbb_dispatcher; + global $template, $db, $user, $auth, $phpbb_container, $phpbb_dispatcher; $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . phpbb_extra_url()); @@ -156,8 +156,6 @@ function mcp_topic_view($id, $mode, $action) } $db->sql_freeresult($result); - $topic_tracking_info = array(); - // Get topic tracking info if ($config['load_db_lastread']) { @@ -173,11 +171,9 @@ function mcp_topic_view($id, $mode, $action) $has_unapproved_posts = $has_deleted_posts = false; // Grab extensions - $extensions = $attachments = array(); + $attachments = array(); if ($topic_info['topic_attachment'] && sizeof($post_id_list)) { - $extensions = $cache->obtain_attach_extensions($topic_info['forum_id']); - // Get attachments... if ($auth->acl_get('u_download') && $auth->acl_get('f_download', $topic_info['forum_id'])) { @@ -271,8 +267,6 @@ function mcp_topic_view($id, $mode, $action) 'U_MCP_REPORT' => ($auth->acl_get('m_report', $topic_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $topic_info['forum_id'] . '&p=' . $row['post_id']) : '', ); - $current_row_number = $i; - /** * Event to modify the template data block for topic reviews in the MCP * @@ -481,7 +475,6 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) 'to_forum_id' => $to_forum_id, 'icon' => $request->variable('icon', 0)) ); - $success_msg = $return_link = ''; if (confirm_box(true)) { @@ -644,7 +637,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) */ function merge_posts($topic_id, $to_topic_id) { - global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $phpbb_log, $request; + global $db, $template, $user, $phpEx, $phpbb_root_path, $phpbb_log, $request; if (!$to_topic_id) { @@ -696,7 +689,7 @@ function merge_posts($topic_id, $to_topic_id) 'redirect' => $redirect, 't' => $topic_id) ); - $success_msg = $return_link = ''; + $return_link = ''; if (confirm_box(true)) { diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index d4c5486ed4..0b66aae030 100644 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -35,8 +35,7 @@ class mcp_warn function main($id, $mode) { - global $auth, $db, $user, $template, $request; - global $config, $phpbb_root_path, $phpEx; + global $request; $action = $request->variable('action', array('' => '')); @@ -78,8 +77,8 @@ class mcp_warn */ function mcp_warn_front_view() { - global $phpEx, $phpbb_root_path, $config; - global $template, $db, $user, $auth; + global $phpEx, $phpbb_root_path; + global $template, $db, $user; $template->assign_vars(array( 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp&field=username&select_single=true'), @@ -132,7 +131,7 @@ class mcp_warn function mcp_warn_list_view($action) { global $phpEx, $phpbb_root_path, $config, $phpbb_container; - global $template, $db, $user, $auth, $request; + global $template, $user, $auth, $request; /* @var $pagination \phpbb\pagination */ $pagination = $phpbb_container->get('pagination'); @@ -191,7 +190,7 @@ class mcp_warn function mcp_warn_post_view($action) { global $phpEx, $phpbb_root_path, $config, $request; - global $template, $db, $user, $auth, $phpbb_dispatcher; + global $template, $db, $user, $phpbb_dispatcher; $post_id = $request->variable('p', 0); $forum_id = $request->variable('f', 0); @@ -370,8 +369,8 @@ class mcp_warn */ function mcp_warn_user_view($action) { - global $phpEx, $phpbb_root_path, $config, $module, $request; - global $template, $db, $user, $auth, $phpbb_dispatcher; + global $phpEx, $phpbb_root_path, $config, $request; + global $template, $db, $user, $phpbb_dispatcher; $user_id = $request->variable('u', 0); $username = $request->variable('username', '', true); @@ -524,7 +523,7 @@ class mcp_warn function add_warning($user_row, $warning, $send_pm = true, $post_id = 0) { global $phpEx, $phpbb_root_path, $config, $phpbb_log; - global $template, $db, $user, $auth; + global $db, $user; if ($send_pm) { diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 059037168d..97e0dd9f0d 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -798,8 +798,6 @@ class bbcode_firstpass extends bbcode */ function bbcode_quote($in) { - global $config, $user; - $in = str_replace("\r\n", "\n", str_replace('\"', '"', trim($in))); if (!$in) @@ -1009,8 +1007,6 @@ class bbcode_firstpass extends bbcode */ function validate_url($var1, $var2) { - global $config; - $var1 = str_replace("\r\n", "\n", str_replace('\"', '"', trim($var1))); $var2 = str_replace("\r\n", "\n", str_replace('\"', '"', trim($var2))); @@ -1155,7 +1151,7 @@ class parse_message extends bbcode_firstpass */ function parse($allow_bbcode, $allow_magic_url, $allow_smilies, $allow_img_bbcode = true, $allow_flash_bbcode = true, $allow_quote_bbcode = true, $allow_url_bbcode = true, $update_this_message = true, $mode = 'post') { - global $config, $db, $user, $phpbb_dispatcher, $phpbb_container; + global $config, $user, $phpbb_dispatcher, $phpbb_container; $this->mode = $mode; @@ -1770,7 +1766,7 @@ class parse_message extends bbcode_firstpass */ function get_submitted_attachment_data($check_user_id = false) { - global $user, $db, $phpbb_root_path, $phpEx, $config; + global $user, $db; global $request; $this->filename_data['filecomment'] = $request->variable('filecomment', '', true); @@ -1858,7 +1854,7 @@ class parse_message extends bbcode_firstpass */ function parse_poll(&$poll) { - global $auth, $user, $config; + global $user, $config; $poll_max_options = $poll['poll_max_options']; diff --git a/phpBB/includes/questionnaire/questionnaire.php b/phpBB/includes/questionnaire/questionnaire.php index 8fe93735ee..60e63eddc4 100644 --- a/phpBB/includes/questionnaire/questionnaire.php +++ b/phpBB/includes/questionnaire/questionnaire.php @@ -257,7 +257,7 @@ class phpbb_questionnaire_phpbb_data_provider */ function get_data() { - global $phpbb_root_path, $phpEx, $phpbb_config_php_file; + global $phpbb_config_php_file; extract($phpbb_config_php_file->get_all()); unset($dbhost, $dbport, $dbname, $dbuser, $dbpasswd); // Just a precaution diff --git a/phpBB/includes/sphinxapi.php b/phpBB/includes/sphinxapi.php index 6c3b66710c..5e1f131ac2 100644 --- a/phpBB/includes/sphinxapi.php +++ b/phpBB/includes/sphinxapi.php @@ -1659,7 +1659,6 @@ class SphinxClient return false; } - $res = substr ( $response, 4 ); // just ignore length, error handling, etc $p = 0; list ( $rows, $cols ) = array_values ( unpack ( "N*N*", substr ( $response, $p, 8 ) ) ); $p += 8; diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php index 5bfb688d3a..00044340df 100644 --- a/phpBB/includes/ucp/ucp_activate.php +++ b/phpBB/includes/ucp/ucp_activate.php @@ -30,7 +30,7 @@ class ucp_activate function main($id, $mode) { global $config, $phpbb_root_path, $phpEx, $request; - global $db, $user, $auth, $template, $phpbb_container, $phpbb_log, $phpbb_dispatcher; + global $db, $user, $auth, $phpbb_container, $phpbb_log, $phpbb_dispatcher; $user_id = $request->variable('u', 0); $key = $request->variable('k', ''); diff --git a/phpBB/includes/ucp/ucp_attachments.php b/phpBB/includes/ucp/ucp_attachments.php index b8cb3c4100..66c3109b3d 100644 --- a/phpBB/includes/ucp/ucp_attachments.php +++ b/phpBB/includes/ucp/ucp_attachments.php @@ -36,7 +36,6 @@ class ucp_attachments $sort_dir = $request->variable('sd', 'a'); $delete = (isset($_POST['delete'])) ? true : false; - $confirm = (isset($_POST['confirm'])) ? true : false; $delete_ids = array_keys($request->variable('attachment', array(0))); if ($delete && sizeof($delete_ids)) diff --git a/phpBB/includes/ucp/ucp_confirm.php b/phpBB/includes/ucp/ucp_confirm.php index 403f7d37d0..cdf4de65fd 100644 --- a/phpBB/includes/ucp/ucp_confirm.php +++ b/phpBB/includes/ucp/ucp_confirm.php @@ -36,7 +36,7 @@ class ucp_confirm function main($id, $mode) { - global $db, $user, $phpbb_root_path, $config, $phpEx, $phpbb_container, $request; + global $config, $phpbb_container, $request; $captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']); $captcha->init($request->variable('type', 0)); diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index 2746e74ffe..1273ea9723 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -38,8 +38,6 @@ class ucp_groups $mark_ary = $request->variable('mark', array(0)); $submit = $request->variable('submit', false, false, \phpbb\request\request_interface::POST); - $delete = $request->variable('delete', false, false, \phpbb\request\request_interface::POST); - $error = $data = array(); /** @var \phpbb\group\helper $group_helper */ $group_helper = $phpbb_container->get('group_helper'); @@ -462,11 +460,8 @@ class ucp_groups trigger_error($user->lang['NOT_LEADER_OF_GROUP'] . $return_page); } - $file_uploads = (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on') ? true : false; $user->add_lang(array('acp/groups', 'acp/common')); - $data = $submit_ary = array(); - $update = (isset($_POST['update'])) ? true : false; $error = array(); @@ -535,7 +530,6 @@ class ucp_groups { // Handle avatar $driver_name = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', '')); - $config_name = preg_replace('#^avatar\.driver.#', '', $driver_name); if (in_array($driver_name, $avatar_drivers) && !$request->is_set_post('avatar_delete')) { @@ -624,7 +618,6 @@ class ucp_groups } else if (!$group_id) { - $group_name = $request->variable('group_name', '', true); $group_desc_data = array( 'text' => '', 'allow_bbcode' => true, diff --git a/phpBB/includes/ucp/ucp_login_link.php b/phpBB/includes/ucp/ucp_login_link.php index 902fbaafcf..f4d47e30bb 100644 --- a/phpBB/includes/ucp/ucp_login_link.php +++ b/phpBB/includes/ucp/ucp_login_link.php @@ -99,7 +99,7 @@ class ucp_login_link else { // Finish login - $result = $user->session_create($login_result['user_row']['user_id'], false, false, true); + $user->session_create($login_result['user_row']['user_id'], false, false, true); // Perform a redirect as the account has been linked $this->perform_redirect(); @@ -182,7 +182,7 @@ class ucp_login_link */ protected function process_login_result($result) { - global $config, $request, $template, $user, $phpbb_container; + global $config, $template, $user, $phpbb_container; $login_error = null; diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index 036025e84e..217d46b767 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -221,7 +221,6 @@ class ucp_main { $forums = array_keys($request->variable('f', array(0 => 0))); $topics = array_keys($request->variable('t', array(0 => 0))); - $msg = ''; if (sizeof($forums) || sizeof($topics)) { diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 024a9c332f..e707c251fe 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -598,7 +598,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) $enable_urls = true; } - $enable_magic_url = $drafts = false; + $drafts = false; // User own some drafts? if ($auth->acl_get('u_savedrafts') && $action != 'delete') @@ -739,16 +739,6 @@ function compose_pm($id, $mode, $action, $user_folders = array()) $enable_urls = (isset($_POST['disable_magic_url'])) ? 0 : 1; $enable_sig = (!$config['allow_sig'] ||!$config['allow_sig_pm']) ? false : ((isset($_POST['attach_sig'])) ? true : false); - if ($submit) - { - $status_switch = (($enable_bbcode+1) << 8) + (($enable_smilies+1) << 4) + (($enable_urls+1) << 2) + (($enable_sig+1) << 1); - $status_switch = ($status_switch != $check_value); - } - else - { - $status_switch = 1; - } - // Parse Attachments - before checksum is calculated $message_parser->parse_attachments('fileupload', $action, 0, $submit, $preview, $refresh, true); @@ -1062,7 +1052,6 @@ function compose_pm($id, $mode, $action, $user_folders = array()) } // Now Build the address list - $plain_address_field = ''; foreach ($address_list as $type => $adr_ary) { foreach ($adr_ary as $id => $field) diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php index 2ccd4a7728..2458c4118d 100644 --- a/phpBB/includes/ucp/ucp_pm_options.php +++ b/phpBB/includes/ucp/ucp_pm_options.php @@ -24,7 +24,7 @@ if (!defined('IN_PHPBB')) */ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_conditions) { - global $phpbb_root_path, $phpEx, $user, $template, $auth, $config, $db, $request; + global $phpbb_root_path, $phpEx, $user, $template, $config, $db, $request; $redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=options"); @@ -80,7 +80,6 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit if (check_form_key('ucp_pm_options')) { $folder_name = $request->variable('foldername', '', true); - $msg = ''; if ($folder_name) { @@ -611,7 +610,7 @@ function define_check_option($hardcoded, $check_option, $check_lang) */ function define_action_option($hardcoded, $action_option, $action_lang, $folder) { - global $db, $template, $user; + global $template; $l_action = $s_action_options = ''; if ($hardcoded) @@ -722,7 +721,6 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule // Define Condition $condition = $global_rule_conditions[$rule_option]; - $current_value = ''; switch ($condition) { diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php index e88e40a1cb..af2126c83d 100644 --- a/phpBB/includes/ucp/ucp_pm_viewfolder.php +++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -41,9 +41,6 @@ function view_folder($id, $mode, $folder_id, $folder) $color_rows = array('marked', 'replied'); - // only show the friend/foe color rows if the module is enabled - $zebra_enabled = false; - $_module = new p_master(); $_module->list_modules('ucp'); $_module->set_active('zebra'); diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 3de3410ea8..2457ea9a2e 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -24,7 +24,7 @@ if (!defined('IN_PHPBB')) */ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) { - global $user, $template, $auth, $db, $cache, $phpbb_container; + global $user, $template, $auth, $db, $phpbb_container; global $phpbb_root_path, $request, $phpEx, $config, $phpbb_dispatcher; $user->add_lang(array('viewtopic', 'memberlist')); @@ -50,9 +50,6 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) trigger_error('NO_AUTH_READ_HOLD_MESSAGE'); } - // Grab icons - $icons = $cache->obtain_icons(); - // Load the custom profile fields if ($config['load_cpf_pm']) { @@ -357,7 +354,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) */ function get_user_information($user_id, $user_row) { - global $db, $auth, $user, $cache; + global $db, $auth, $user; global $phpbb_root_path, $phpEx, $config; if (!$user_id) diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index b8e34af931..c2aa910ed0 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -29,7 +29,7 @@ class ucp_prefs function main($id, $mode) { - global $config, $db, $user, $auth, $template, $phpbb_dispatcher, $phpbb_root_path, $phpEx, $request; + global $config, $db, $user, $auth, $template, $phpbb_dispatcher, $request; $submit = (isset($_POST['submit'])) ? true : false; $error = $data = array(); diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index f6e9acc8c4..4ac8e0f17d 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -31,13 +31,12 @@ class ucp_profile function main($id, $mode) { - global $cache, $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx; + global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx; global $request, $phpbb_container, $phpbb_log, $phpbb_dispatcher; $user->add_lang('posting'); $submit = $request->variable('submit', false, false, \phpbb\request\request_interface::POST); - $delete = $request->variable('delete', false, false, \phpbb\request\request_interface::POST); $error = $data = array(); $s_hidden_fields = ''; @@ -430,7 +429,6 @@ class ucp_profile $selected = ($i == $data['bday_month']) ? ' selected="selected"' : ''; $s_birthday_month_options .= "<option value=\"$i\"$selected>$i</option>"; } - $s_birthday_year_options = ''; $now = getdate(); $s_birthday_year_options = '<option value="0"' . ((!$data['bday_year']) ? ' selected="selected"' : '') . '>--</option>'; diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 4f9639114f..1b62790700 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -29,7 +29,7 @@ class ucp_register function main($id, $mode) { - global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx; + global $config, $db, $user, $template, $phpbb_root_path, $phpEx; global $request, $phpbb_container, $phpbb_dispatcher; // @@ -484,7 +484,6 @@ class ucp_register $s_hidden_fields = array_merge($s_hidden_fields, $captcha->get_hidden_fields()); } $s_hidden_fields = build_hidden_fields($s_hidden_fields); - $confirm_image = ''; // Visual Confirmation - Show images if ($config['enable_confirm']) @@ -507,7 +506,9 @@ class ucp_register break; } - $timezone_selects = phpbb_timezone_select($template, $user, $data['tz'], true); + // Assign template vars for timezone select + phpbb_timezone_select($template, $user, $data['tz'], true); + $template->assign_vars(array( 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '', 'USERNAME' => $data['username'], diff --git a/phpBB/includes/ucp/ucp_remind.php b/phpBB/includes/ucp/ucp_remind.php index 2342aa2137..0a46674fb1 100644 --- a/phpBB/includes/ucp/ucp_remind.php +++ b/phpBB/includes/ucp/ucp_remind.php @@ -30,7 +30,7 @@ class ucp_remind function main($id, $mode) { global $config, $phpbb_root_path, $phpEx, $request; - global $db, $user, $auth, $template, $phpbb_container; + global $db, $user, $template, $phpbb_container; if (!$config['allow_password_reset']) { diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php index d4e7e70247..fa6a03f87c 100644 --- a/phpBB/includes/ucp/ucp_zebra.php +++ b/phpBB/includes/ucp/ucp_zebra.php @@ -25,7 +25,7 @@ class ucp_zebra function main($id, $mode) { - global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx, $request, $phpbb_dispatcher; + global $db, $user, $auth, $template, $phpbb_root_path, $phpEx, $request, $phpbb_dispatcher; $submit = (isset($_POST['submit']) || isset($_GET['add']) || isset($_GET['remove'])) ? true : false; $s_hidden_fields = ''; diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php index da241b2cbd..01caf47349 100644 --- a/phpBB/includes/utf/utf_tools.php +++ b/phpBB/includes/utf/utf_tools.php @@ -1153,7 +1153,6 @@ function utf8_case_fold_nfkc($text, $option = 'full') "\xF0\x9D\x9E\xBB" => "\xCF\x83", "\xF0\x9D\x9F\x8A" => "\xCF\x9D", ); - global $phpbb_root_path, $phpEx; // do the case fold $text = utf8_case_fold($text, $option); @@ -1244,7 +1243,6 @@ function utf8_case_fold_nfc($text, $option = 'full') "\xE1\xBF\xB7" => "\xE1\xBF\xB6\xCD\x85", "\xE1\xBF\xBC" => "\xCE\xA9\xCD\x85", ); - global $phpbb_root_path, $phpEx; // perform a small trick, avoid further normalization on composed points that contain U+0345 in their decomposition $text = strtr($text, $ypogegrammeni); |