diff options
106 files changed, 240 insertions, 454 deletions
diff --git a/phpBB/develop/add_permissions.php b/phpBB/develop/add_permissions.php index 88c2c35ac0..a6fc8d686c 100644 --- a/phpBB/develop/add_permissions.php +++ b/phpBB/develop/add_permissions.php @@ -389,7 +389,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting) foreach ($sql_subary as $sql) { $sql = "INSERT INTO $table ($id_field, forum_id, auth_option_id, auth_setting) VALUES ($sql)"; - $result = $db->sql_query($sql); + $db->sql_query($sql); $sql = ''; } } @@ -397,7 +397,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting) if ($sql != '') { $sql = "INSERT INTO $table ($id_field, forum_id, auth_option_id, auth_setting) $sql"; - $result = $db->sql_query($sql); + $db->sql_query($sql); } break; @@ -405,7 +405,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting) case 'delete': foreach ($sql_subary as $sql) { - $result = $db->sql_query($sql); + $db->sql_query($sql); $sql = ''; } break; diff --git a/phpBB/develop/benchmark.php b/phpBB/develop/benchmark.php index c3cf90773e..631b7d05ca 100644 --- a/phpBB/develop/benchmark.php +++ b/phpBB/develop/benchmark.php @@ -143,7 +143,7 @@ function filldb($newposts) if ((rand(0,30) < 1) || ($forum_topic_count[$forum] == 0)) { // create a new topic 1 in 30 times (or when there are none); - $topic = make_topic($userid, "Testing topic $i", $forum); + make_topic($userid, "Testing topic $i", $forum); $forum_topic_count[$forum]++; } else diff --git a/phpBB/develop/unicode_testing.php b/phpBB/develop/unicode_testing.php index ca6d1b5f48..01586ca09b 100644 --- a/phpBB/develop/unicode_testing.php +++ b/phpBB/develop/unicode_testing.php @@ -19,7 +19,7 @@ if (!headers_sent()) function unicode_to_utf8($string) { $utf8 = ''; - $chars = array(); + for ($i = 0; $i < strlen($string); $i++) { if (isset($string[$i + 5]) && substr($string, $i, 2) == '\\u' && ctype_xdigit(substr($string, $i + 2, 4))) 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..114cba37f6 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -25,8 +25,8 @@ 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'); 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..31fbbde2a7 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; 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 4a52657023..3f64bc19f9 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; @@ -140,8 +140,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 @@ -273,7 +273,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]) ) { @@ -285,7 +285,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]; @@ -321,8 +321,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']); @@ -652,8 +650,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); diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index aa2c59f28c..e8de7ef3e1 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -54,7 +54,7 @@ function phpbb_forum_flags() */ function phpbb_insert_forums() { - global $db, $src_db, $same_db, $convert, $user, $config; + global $db, $src_db, $same_db, $convert, $user; $db->sql_query($convert->truncate_statement . FORUMS_TABLE); @@ -179,7 +179,6 @@ function phpbb_insert_forums() $db->sql_query($sql); $cats_added[$unknown_cat_id] = $max_forum_id; - $max_forum_id++; } // Now insert the forums @@ -422,8 +421,6 @@ function phpbb_set_encoding($text, $grab_user_lang = true) } } - $encoding = $lang_enc_array[$get_lang]; - return utf8_recode($text, $lang_enc_array[$get_lang]); } @@ -564,7 +561,7 @@ function phpbb_copy_table_fields() */ function phpbb_convert_authentication($mode) { - global $db, $src_db, $same_db, $convert, $user, $config, $cache; + global $db, $src_db, $same_db, $convert, $config; if ($mode == 'start') { @@ -1221,7 +1218,7 @@ function phpbb_replace_size($matches) */ function phpbb_prepare_message($message) { - global $phpbb_root_path, $phpEx, $db, $convert, $user, $config, $cache, $convert_row, $message_parser; + global $convert, $user, $convert_row, $message_parser; if (!$message) { @@ -1251,9 +1248,6 @@ function phpbb_prepare_message($message) $message = str_replace('\"', '"', $message); } - // Already the new user id ;) - $user_id = $convert->row['poster_id']; - $message = str_replace('<br />', "\n", $message); $message = str_replace('<', '<', $message); $message = str_replace('>', '>', $message); @@ -1305,7 +1299,7 @@ function get_bbcode_bitfield() */ function phpbb_post_edit_user() { - global $convert_row, $config; + global $convert_row; if (isset($convert_row['post_edit_count'])) { @@ -1326,7 +1320,7 @@ function phpbb_get_files_dir() return; } - global $src_db, $same_db, $convert, $user, $config, $cache; + global $src_db, $same_db, $convert, $user; if ($convert->mysql_convert && $same_db) { @@ -1365,7 +1359,7 @@ function phpbb_get_files_dir() */ function phpbb_copy_thumbnails() { - global $db, $convert, $user, $config, $cache, $phpbb_root_path; + global $convert, $config, $phpbb_root_path; $src_path = $convert->options['forum_path'] . '/' . phpbb_get_files_dir() . '/thumbs/'; @@ -1611,8 +1605,6 @@ function phpbb_get_avatar_width($user_avatar) */ function phpbb_privmsgs_to_userid($to_userid) { - global $config; - return 'u_' . phpbb_user_id($to_userid); } @@ -1659,7 +1651,7 @@ function phpbb_get_savebox_id($user_id) */ function phpbb_import_attach_config() { - global $db, $src_db, $same_db, $convert, $config; + global $src_db, $same_db, $convert, $config; if ($convert->mysql_convert && $same_db) { @@ -1765,9 +1757,8 @@ function phpbb_disallowed_username($username) */ function phpbb_create_userconv_table() { - global $db, $src_db, $convert, $table_prefix, $user, $lang; + global $db; - $map_dbms = ''; switch ($db->get_sql_layer()) { case 'mysql': @@ -1856,7 +1847,7 @@ function phpbb_create_userconv_table() function phpbb_check_username_collisions() { - global $db, $src_db, $convert, $table_prefix, $user, $lang; + global $db, $src_db, $convert, $user, $lang; // now find the clean version of the usernames that collide $sql = 'SELECT username_clean @@ -1969,7 +1960,7 @@ function phpbb_add_notification_options($user_notify_pm) ); } - $sql = $db->sql_multi_insert(USER_NOTIFICATIONS_TABLE, $rows); + $db->sql_multi_insert(USER_NOTIFICATIONS_TABLE, $rows); } function phpbb_convert_password_hash($hash) diff --git a/phpBB/install/data/confusables.php b/phpBB/install/data/confusables.php index 992207c1ef..00e806f639 100644 --- a/phpBB/install/data/confusables.php +++ b/phpBB/install/data/confusables.php @@ -628,7 +628,6 @@ function utf8_new_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_new_case_fold($text, $option); diff --git a/phpBB/phpbb/captcha/gd.php b/phpBB/phpbb/captcha/gd.php index 652df28f8a..e9538439c6 100644 --- a/phpBB/phpbb/captcha/gd.php +++ b/phpBB/phpbb/captcha/gd.php @@ -97,13 +97,12 @@ class gd if ($config['captcha_gd_3d_noise']) { - $xoffset = mt_rand(0,9); $noise_bitmaps = $this->captcha_noise_bg_bitmaps(); for ($i = 0; $i < $code_len; ++$i) { $noise[$i] = new char_cube3d($noise_bitmaps, mt_rand(1, sizeof($noise_bitmaps['data']))); - list($min, $max) = $noise[$i]->range(); + $noise[$i]->range(); //$box = $noise[$i]->dimensions($sizes[$i]); } $xoffset = 0; @@ -151,8 +150,6 @@ class gd */ function wave($img) { - global $config; - $period_x = mt_rand(12,18); $period_y = mt_rand(7,14); $amp_x = mt_rand(5,10); diff --git a/phpBB/phpbb/captcha/gd_wave.php b/phpBB/phpbb/captcha/gd_wave.php index d48fc753a5..f2ec4137d2 100644 --- a/phpBB/phpbb/captcha/gd_wave.php +++ b/phpBB/phpbb/captcha/gd_wave.php @@ -23,8 +23,6 @@ class gd_wave function execute($code, $seed) { - global $starttime; - // seed the random generator mt_srand($seed); @@ -77,7 +75,6 @@ class gd_wave // TODO $background = imagecolorallocate($img, mt_rand(155, 255), mt_rand(155, 255), mt_rand(155, 255)); imagefill($img, 0, 0, $background); - $black = imagecolorallocate($img, 0, 0, 0); $random = array(); $fontcolors = array(); @@ -155,7 +152,7 @@ class gd_wave // rather than recalculating from absolute coordinates // What we cache into the $img_buffer contains the raised text coordinates. $img_pos_prev = $img_buffer[0][0] = array($box['upper_left']['x'], $box['upper_left']['y']); - $cur_height = $prev_height = $this->wave_height(0, 0, $subdivision_factor); + $prev_height = $this->wave_height(0, 0, $subdivision_factor); $full_x = $plane_x * $subdivision_factor; $full_y = $plane_y * $subdivision_factor; diff --git a/phpBB/phpbb/captcha/plugins/captcha_abstract.php b/phpBB/phpbb/captcha/plugins/captcha_abstract.php index b29f144f97..82b08704ff 100644 --- a/phpBB/phpbb/captcha/plugins/captcha_abstract.php +++ b/phpBB/phpbb/captcha/plugins/captcha_abstract.php @@ -34,7 +34,7 @@ abstract class captcha_abstract function init($type) { - global $config, $db, $user, $request; + global $config, $request; // read input $this->confirm_id = $request->variable('confirm_id', ''); @@ -56,8 +56,6 @@ abstract class captcha_abstract function execute_demo() { - global $user; - $this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS)); $this->seed = hexdec(substr(unique_id(), 4, 10)); @@ -117,7 +115,7 @@ abstract class captcha_abstract function get_demo_template($id) { - global $config, $user, $template, $request, $phpbb_admin_path, $phpEx; + global $config, $template, $request, $phpbb_admin_path, $phpEx; $variables = ''; @@ -153,7 +151,7 @@ abstract class captcha_abstract function garbage_collect($type) { - global $db, $config; + global $db; $sql = 'SELECT DISTINCT c.session_id FROM ' . CONFIRM_TABLE . ' c @@ -193,7 +191,7 @@ abstract class captcha_abstract function validate() { - global $config, $db, $user; + global $user; if (!$user->is_setup()) { diff --git a/phpBB/phpbb/captcha/plugins/gd.php b/phpBB/phpbb/captcha/plugins/gd.php index 1727dcc1bb..831e5bcfdf 100644 --- a/phpBB/phpbb/captcha/plugins/gd.php +++ b/phpBB/phpbb/captcha/plugins/gd.php @@ -53,18 +53,11 @@ class gd extends captcha_abstract function acp_page($id, &$module) { - global $db, $user, $auth, $template, $phpbb_log, $request; - global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $user, $template, $phpbb_log, $request; + global $config; $user->add_lang('acp/board'); - $config_vars = array( - 'enable_confirm' => 'REG_ENABLE', - 'enable_post_confirm' => 'POST_ENABLE', - 'confirm_refresh' => 'CONFIRM_REFRESH', - 'captcha_gd' => 'CAPTCHA_GD', - ); - $module->tpl_name = 'captcha_gd_acp'; $module->page_title = 'ACP_VC_SETTINGS'; $form_key = 'acp_captcha'; diff --git a/phpBB/phpbb/captcha/plugins/gd_wave.php b/phpBB/phpbb/captcha/plugins/gd_wave.php index e1d44df778..bde46f8815 100644 --- a/phpBB/phpbb/captcha/plugins/gd_wave.php +++ b/phpBB/phpbb/captcha/plugins/gd_wave.php @@ -35,7 +35,7 @@ class gd_wave extends captcha_abstract function acp_page($id, &$module) { - global $config, $db, $template, $user; + global $user; trigger_error($user->lang['CAPTCHA_NO_OPTIONS'] . adm_back_link($module->u_action)); } diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php index 5f06cb08fc..30cb667344 100644 --- a/phpBB/phpbb/db/driver/driver.php +++ b/phpBB/phpbb/db/driver/driver.php @@ -1012,7 +1012,7 @@ abstract class driver implements driver_interface */ function sql_report($mode, $query = '') { - global $cache, $starttime, $phpbb_root_path, $phpbb_path_helper, $user; + global $cache, $starttime, $phpbb_root_path, $phpbb_path_helper; global $request; if (is_object($request) && !$request->variable('explain', false)) diff --git a/phpBB/phpbb/db/driver/oracle.php b/phpBB/phpbb/db/driver/oracle.php index 89e1b68aac..54238a15ef 100644 --- a/phpBB/phpbb/db/driver/oracle.php +++ b/phpBB/phpbb/db/driver/oracle.php @@ -84,8 +84,6 @@ class oracle extends \phpbb\db\driver\driver * but I assume its because the Oracle extension provides a direct method to access it * without a query. */ - - $use_cache = false; /* global $cache; diff --git a/phpBB/phpbb/db/extractor/oracle_extractor.php b/phpBB/phpbb/db/extractor/oracle_extractor.php index 05f7b8ac95..79a991889b 100644 --- a/phpBB/phpbb/db/extractor/oracle_extractor.php +++ b/phpBB/phpbb/db/extractor/oracle_extractor.php @@ -192,8 +192,6 @@ class oracle_extractor extends base_extractor $ary_name[$i] = ocicolumnname($result, $i + 1); } - $sql_data = ''; - while ($row = $this->db->sql_fetchrow($result)) { $schema_vals = $schema_fields = array(); diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php index 9f6e3efb91..084d00a13a 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php @@ -118,7 +118,7 @@ class release_3_0_5_rc1 extends container_aware_migration $result = $this->db->sql_query($sql); // Skip first row, this is our original auth option we want to preserve - $row = $this->db->sql_fetchrow($result); + $this->db->sql_fetchrow($result); while ($row = $this->db->sql_fetchrow($result)) { diff --git a/phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php b/phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php index 854ed1f568..14b7b7b0f6 100644 --- a/phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php +++ b/phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php @@ -45,7 +45,6 @@ class update_custom_bbcodes_with_idn extends \phpbb\db\migration\migration $sql_ary = array(); while ($row = $this->db->sql_fetchrow($result)) { - $data = array(); if (preg_match('/(URL|LOCAL_URL|RELATIVE_URL)/', $row['bbcode_match'])) { $data = $bbcodes->build_regexp($row['bbcode_match'], $row['bbcode_tpl']); diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php index a809bc14f9..d91860949a 100644 --- a/phpBB/phpbb/db/migrator.php +++ b/phpBB/phpbb/db/migrator.php @@ -535,7 +535,7 @@ class migrator } // Reverse the step that was run - $result = $this->run_step($reverse_step, false, !$revert); + $this->run_step($reverse_step, false, !$revert); } // rethrow the exception diff --git a/phpBB/phpbb/db/tools/tools.php b/phpBB/phpbb/db/tools/tools.php index 1d7b2ddfff..f06871a1d7 100644 --- a/phpBB/phpbb/db/tools/tools.php +++ b/phpBB/phpbb/db/tools/tools.php @@ -1116,7 +1116,7 @@ class tools implements tools_interface } // Get type - list($column_type, $orig_column_type) = $this->get_column_type($column_data[0]); + list($column_type) = $this->get_column_type($column_data[0]); // Adjust default value if db-dependent specified if (is_array($column_data[1])) diff --git a/phpBB/phpbb/files/types/remote.php b/phpBB/phpbb/files/types/remote.php index 4f4ce15c18..33cbfb00ae 100644 --- a/phpBB/phpbb/files/types/remote.php +++ b/phpBB/phpbb/files/types/remote.php @@ -97,7 +97,6 @@ class remote extends base $url['path'] = implode('', $url['path']); $upload_ary['name'] = utf8_basename($url['path']) . (($ext) ? '.' . $ext : ''); - $filename = $url['path']; $filesize = 0; $remote_max_filesize = $this->get_max_file_size(); diff --git a/phpBB/phpbb/install/console/command/install/config/validate.php b/phpBB/phpbb/install/console/command/install/config/validate.php index 19b6f99a8b..3bbbc23e34 100644 --- a/phpBB/phpbb/install/console/command/install/config/validate.php +++ b/phpBB/phpbb/install/console/command/install/config/validate.php @@ -117,7 +117,7 @@ class validate extends \phpbb\console\command\command try { - $config = $processor->processConfiguration($configuration, $config); + $processor->processConfiguration($configuration, $config); } catch (Exception $e) { diff --git a/phpBB/phpbb/install/controller/install.php b/phpBB/phpbb/install/controller/install.php index 8bf9062b08..b987d91c6a 100644 --- a/phpBB/phpbb/install/controller/install.php +++ b/phpBB/phpbb/install/controller/install.php @@ -19,7 +19,6 @@ use phpbb\install\helper\navigation\navigation_provider; use Symfony\Component\HttpFoundation\StreamedResponse; use Symfony\Component\HttpFoundation\Response; use phpbb\install\helper\iohandler\factory; -use phpbb\install\controller\helper; use phpbb\template\template; use phpbb\request\request_interface; use phpbb\install\installer; diff --git a/phpBB/phpbb/log/log.php b/phpBB/phpbb/log/log.php index f0ba120625..436c21bdad 100644 --- a/phpBB/phpbb/log/log.php +++ b/phpBB/phpbb/log/log.php @@ -420,7 +420,7 @@ class log implements \phpbb\log\log_interface $this->entry_count = 0; $this->last_page_offset = $offset; - $post_id_list = $topic_id_list = $reportee_id_list = array(); + $topic_id_list = $reportee_id_list = array(); $profile_url = ($this->get_is_admin() && $this->phpbb_admin_path) ? append_sid("{$this->phpbb_admin_path}index.{$this->php_ext}", 'i=users&mode=overview') : append_sid("{$this->phpbb_root_path}memberlist.{$this->php_ext}", 'mode=viewprofile'); diff --git a/phpBB/phpbb/report/report_handler_post.php b/phpBB/phpbb/report/report_handler_post.php index ce4ed67d27..5574a16dc0 100644 --- a/phpBB/phpbb/report/report_handler_post.php +++ b/phpBB/phpbb/report/report_handler_post.php @@ -66,7 +66,7 @@ class report_handler_post extends report_handler 'reported_post_enable_magic_url' => $this->report_data['enable_magic_url'], ); - $report_id = $this->create_report($report_data); + $this->create_report($report_data); $sql = 'UPDATE ' . POSTS_TABLE . ' SET post_reported = 1 diff --git a/phpBB/phpbb/request/type_cast_helper.php b/phpBB/phpbb/request/type_cast_helper.php index bc654e6182..96e66950ca 100644 --- a/phpBB/phpbb/request/type_cast_helper.php +++ b/phpBB/phpbb/request/type_cast_helper.php @@ -172,7 +172,6 @@ class type_cast_helper implements \phpbb\request\type_cast_helper_interface } list($default_key, $default_value) = each($default); - $value_type = gettype($default_value); $key_type = gettype($default_key); $_var = $var; diff --git a/phpBB/phpbb/search/fulltext_native.php b/phpBB/phpbb/search/fulltext_native.php index 3a74955a18..521eebb7ee 100644 --- a/phpBB/phpbb/search/fulltext_native.php +++ b/phpBB/phpbb/search/fulltext_native.php @@ -352,9 +352,6 @@ class fulltext_native extends \phpbb\search\base $this->must_not_contain_ids = array(); $this->must_exclude_one_ids = array(); - $mode = ''; - $ignore_no_id = true; - foreach ($query as $word) { if (empty($word)) @@ -597,7 +594,6 @@ class fulltext_native extends \phpbb\search\base $id_ary = array(); $sql_where = array(); - $group_by = false; $m_num = 0; $w_num = 0; @@ -1328,7 +1324,6 @@ class fulltext_native extends \phpbb\search\base $match[] = '#\[\/?[a-z0-9\*\+\-]+(?:=.*?)?(?::[a-z])?(\:?[0-9a-z]{5,})\]#'; $min = $this->word_length['min']; - $max = $this->word_length['max']; $isset_min = $min - 1; @@ -1737,7 +1732,7 @@ class fulltext_native extends \phpbb\search\base protected function cleanup($text, $allowed_chars = null, $encoding = 'utf-8') { static $conv = array(), $conv_loaded = array(); - $words = $allow = array(); + $allow = array(); // Convert the text to UTF-8 $encoding = strtolower($encoding); diff --git a/phpBB/phpbb/search/fulltext_postgres.php b/phpBB/phpbb/search/fulltext_postgres.php index ab28fd2957..42425cbc6b 100644 --- a/phpBB/phpbb/search/fulltext_postgres.php +++ b/phpBB/phpbb/search/fulltext_postgres.php @@ -501,7 +501,6 @@ class fulltext_postgres extends \phpbb\search\base $sql_select = ($type == 'posts') ? 'p.post_id' : 'DISTINCT t.topic_id'; $sql_from = ($join_topic) ? TOPICS_TABLE . ' t, ' : ''; $field = ($type == 'posts') ? 'post_id' : 'topic_id'; - $sql_author = (sizeof($author_ary) == 1) ? ' = ' . $author_ary[0] : 'IN (' . implode(', ', $author_ary) . ')'; if (sizeof($author_ary) && $author_name) { @@ -526,7 +525,6 @@ class fulltext_postgres extends \phpbb\search\base $sql_where_options .= ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : ''; $sql_where_options .= $sql_match_where; - $tmp_sql_match = array(); $sql_match = str_replace(',', " || ' ' ||", $sql_match); $tmp_sql_match = "to_tsvector ('" . $this->db->sql_escape($this->config['fulltext_postgres_ts_name']) . "', " . $sql_match . ") @@ to_tsquery ('" . $this->db->sql_escape($this->config['fulltext_postgres_ts_name']) . "', '" . $this->db->sql_escape($this->tsearch_query) . "')"; @@ -838,7 +836,7 @@ class fulltext_postgres extends \phpbb\search\base GROUP BY t.topic_id, $sort_by_sql[$sort_key]"; } - $result = $this->db->sql_query($sql_count); + $this->db->sql_query($sql_count); $result_count = (int) $this->db->sql_fetchfield('result_count'); if (!$result_count) diff --git a/phpBB/phpbb/search/fulltext_sphinx.php b/phpBB/phpbb/search/fulltext_sphinx.php index 372a2792cf..504065e8cd 100644 --- a/phpBB/phpbb/search/fulltext_sphinx.php +++ b/phpBB/phpbb/search/fulltext_sphinx.php @@ -404,7 +404,7 @@ class fulltext_sphinx $variable = $section->get_variable_by_name($key); if (!$variable) { - $variable = $section->create_variable($key, $value); + $section->create_variable($key, $value); } else { @@ -413,7 +413,7 @@ class fulltext_sphinx } else { - $variable = $section->create_variable($key, $value); + $section->create_variable($key, $value); } } } @@ -437,7 +437,6 @@ class fulltext_sphinx $match = array('#\sand\s#i', '#\sor\s#i', '#\snot\s#i', '#\+#', '#-#', '#\|#', '#@#'); $replace = array(' & ', ' | ', ' - ', ' +', ' -', ' |', ''); - $replacements = 0; $keywords = preg_replace($match, $replace, $keywords); $this->sphinx->SetMatchMode(SPH_MATCH_EXTENDED); } @@ -490,8 +489,6 @@ class fulltext_sphinx $id_ary = array(); - $join_topic = ($type != 'posts'); - // Sorting if ($type == 'topics') diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php index 5575c22846..6155745c37 100644 --- a/phpBB/phpbb/session.php +++ b/phpBB/phpbb/session.php @@ -494,7 +494,7 @@ class session */ function session_create($user_id = false, $set_admin = false, $persist_login = false, $viewonline = true) { - global $SID, $_SID, $db, $config, $cache, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher; + global $SID, $_SID, $db, $config, $cache, $phpbb_container, $phpbb_dispatcher; $this->data = array(); @@ -883,7 +883,7 @@ class session */ function session_kill($new_session = true) { - global $SID, $_SID, $db, $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher; + global $SID, $_SID, $db, $phpbb_container, $phpbb_dispatcher; $sql = 'DELETE FROM ' . SESSIONS_TABLE . " WHERE session_id = '" . $db->sql_escape($this->session_id) . "' @@ -975,7 +975,7 @@ class session */ function session_gc() { - global $db, $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher; + global $db, $config, $phpbb_container, $phpbb_dispatcher; $batch_size = 10; @@ -1226,7 +1226,7 @@ class session if ($banned && !$return) { - global $template, $phpbb_root_path, $phpEx; + global $phpbb_root_path, $phpEx; // If the session is empty we need to create a valid one... if (empty($this->session_id)) @@ -1403,7 +1403,7 @@ class session */ function set_login_key($user_id = false, $key = false, $user_ip = false) { - global $config, $db; + global $db; $user_id = ($user_id === false) ? $this->data['user_id'] : $user_id; $user_ip = ($user_ip === false) ? $this->ip : $user_ip; @@ -1413,7 +1413,7 @@ class session $sql_ary = array( 'key_id' => (string) md5($key_id), - 'last_ip' => (string) $this->ip, + 'last_ip' => (string) $user_ip, 'last_login' => (int) time() ); @@ -1450,7 +1450,7 @@ class session */ function reset_login_keys($user_id = false) { - global $config, $db; + global $db; $user_id = ($user_id === false) ? (int) $this->data['user_id'] : (int) $user_id; diff --git a/phpBB/phpbb/template/twig/node/includejs.php b/phpBB/phpbb/template/twig/node/includejs.php index 0f67f9ff60..e77f2afeed 100644 --- a/phpBB/phpbb/template/twig/node/includejs.php +++ b/phpBB/phpbb/template/twig/node/includejs.php @@ -28,8 +28,6 @@ class includejs extends \phpbb\template\twig\node\includeasset */ protected function append_asset(\Twig_Compiler $compiler) { - $config = $this->environment->get_phpbb_config(); - $compiler ->raw("<script type=\"text/javascript\" src=\"' . ") ->raw("\$asset_file") diff --git a/phpBB/phpbb/textformatter/s9e/parser.php b/phpBB/phpbb/textformatter/s9e/parser.php index ffaffbc63c..e2653d60f0 100644 --- a/phpBB/phpbb/textformatter/s9e/parser.php +++ b/phpBB/phpbb/textformatter/s9e/parser.php @@ -50,6 +50,7 @@ class parser implements \phpbb\textformatter\parser_interface $this->dispatcher = $dispatcher; $this->parser = $parser; + $parser = $this; /** @@ -195,7 +196,7 @@ class parser implements \phpbb\textformatter\parser_interface $errors = array(); foreach ($this->parser->getLogger()->get() as $entry) { - list($type, $msg, $context) = $entry; + list(, $msg, $context) = $entry; if ($msg === 'Tag limit exceeded') { diff --git a/phpBB/phpbb/textformatter/s9e/renderer.php b/phpBB/phpbb/textformatter/s9e/renderer.php index 2206605ba2..9be20b7f53 100644 --- a/phpBB/phpbb/textformatter/s9e/renderer.php +++ b/phpBB/phpbb/textformatter/s9e/renderer.php @@ -233,6 +233,7 @@ class renderer implements \phpbb\textformatter\renderer_interface { $xml = $this->quote_helper->inject_metadata($xml); } + $renderer = $this; /** diff --git a/phpBB/phpbb/tree/nestedset.php b/phpBB/phpbb/tree/nestedset.php index 8490c7c299..7149513fd9 100644 --- a/phpBB/phpbb/tree/nestedset.php +++ b/phpBB/phpbb/tree/nestedset.php @@ -391,7 +391,6 @@ abstract class nestedset implements \phpbb\tree\tree_interface throw new \OutOfBoundsException($this->message_prefix . 'INVALID_PARENT'); } - $diff = sizeof($move_items) * 2; $sql_exclude_moved_items = $this->db->sql_in_set($this->column_item_id, $move_items, true); $this->db->sql_transaction('begin'); @@ -490,7 +489,6 @@ abstract class nestedset implements \phpbb\tree\tree_interface throw new \OutOfBoundsException($this->message_prefix . 'INVALID_PARENT'); } - $diff = sizeof($move_items) * 2; $sql_exclude_moved_items = $this->db->sql_in_set($this->column_item_id, $move_items, true); $this->db->sql_transaction('begin'); diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php index 173b20ee53..5262e10e87 100644 --- a/phpBB/phpbb/user.php +++ b/phpBB/phpbb/user.php @@ -747,8 +747,6 @@ class user extends \phpbb\session */ function leave_newly_registered() { - global $db; - if (empty($this->data['user_new'])) { return false; |