[ticket/13454] Remove unused variables

This is the first part of the changes. More to come.

PHPBB3-13454
This commit is contained in:
Marc Alexander 2015-12-03 17:50:29 +01:00
parent d0adbe94d5
commit 73e6e5b77f
72 changed files with 85 additions and 144 deletions

View file

@ -143,7 +143,7 @@ function filldb($newposts)
if ((rand(0,30) < 1) || ($forum_topic_count[$forum] == 0)) if ((rand(0,30) < 1) || ($forum_topic_count[$forum] == 0))
{ {
// create a new topic 1 in 30 times (or when there are none); // 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]++; $forum_topic_count[$forum]++;
} }
else else

View file

@ -19,7 +19,7 @@ if (!headers_sent())
function unicode_to_utf8($string) function unicode_to_utf8($string)
{ {
$utf8 = ''; $utf8 = '';
$chars = array();
for ($i = 0; $i < strlen($string); $i++) for ($i = 0; $i < strlen($string); $i++)
{ {
if (isset($string[$i + 5]) && substr($string, $i, 2) == '\\u' && ctype_xdigit(substr($string, $i + 2, 4))) if (isset($string[$i + 5]) && substr($string, $i, 2) == '\\u' && ctype_xdigit(substr($string, $i + 2, 4)))

View file

@ -25,8 +25,8 @@ class acp_bbcodes
function main($id, $mode) function main($id, $mode)
{ {
global $db, $user, $auth, $template, $cache, $request, $phpbb_dispatcher, $phpbb_container; global $db, $user, $template, $cache, $request, $phpbb_dispatcher, $phpbb_container;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_log; global $phpbb_log;
$user->add_lang('acp/posting'); $user->add_lang('acp/posting');

View file

@ -30,13 +30,12 @@ class acp_board
function main($id, $mode) function main($id, $mode)
{ {
global $db, $user, $auth, $template, $request; global $user, $template, $request;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; global $config, $phpbb_root_path, $phpEx;
global $cache, $phpbb_container, $phpbb_dispatcher, $phpbb_log; global $cache, $phpbb_container, $phpbb_dispatcher, $phpbb_log;
$user->add_lang('acp/board'); $user->add_lang('acp/board');
$action = $request->variable('action', '');
$submit = (isset($_POST['submit']) || isset($_POST['allow_quick_reply_enable'])) ? true : false; $submit = (isset($_POST['submit']) || isset($_POST['allow_quick_reply_enable'])) ? true : false;
$form_key = 'acp_board'; $form_key = 'acp_board';

View file

@ -25,8 +25,8 @@ class acp_bots
function main($id, $mode) function main($id, $mode)
{ {
global $config, $db, $user, $auth, $template, $cache, $request, $phpbb_log; global $config, $db, $user, $template, $cache, $request, $phpbb_log;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; global $phpbb_root_path, $phpEx;
$action = $request->variable('action', ''); $action = $request->variable('action', '');
$submit = (isset($_POST['submit'])) ? true : false; $submit = (isset($_POST['submit'])) ? true : false;

View file

@ -25,8 +25,8 @@ class acp_captcha
function main($id, $mode) function main($id, $mode)
{ {
global $user, $auth, $template, $phpbb_log, $request; global $user, $template, $phpbb_log, $request;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container; global $config, $phpbb_container;
$user->add_lang('acp/board'); $user->add_lang('acp/board');

View file

@ -37,7 +37,6 @@ class acp_database
$this->page_title = 'ACP_DATABASE'; $this->page_title = 'ACP_DATABASE';
$action = $request->variable('action', ''); $action = $request->variable('action', '');
$submit = (isset($_POST['submit'])) ? true : false;
$template->assign_vars(array( $template->assign_vars(array(
'MODE' => $mode 'MODE' => $mode

View file

@ -25,8 +25,7 @@ class acp_disallow
function main($id, $mode) function main($id, $mode)
{ {
global $db, $user, $auth, $template, $cache, $phpbb_log, $request; global $db, $user, $template, $cache, $phpbb_log, $request;;
global $config, $phpbb_admin_path;
$user->add_lang('acp/posting'); $user->add_lang('acp/posting');

View file

@ -25,8 +25,8 @@ class acp_email
function main($id, $mode) function main($id, $mode)
{ {
global $config, $db, $user, $auth, $template, $cache, $phpbb_log, $request; global $config, $db, $user, $template, $phpbb_log, $request;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $phpbb_dispatcher; global $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_dispatcher;
$user->add_lang('acp/email'); $user->add_lang('acp/email');
$this->tpl_name = 'acp_email'; $this->tpl_name = 'acp_email';

View file

@ -34,7 +34,7 @@ class acp_extensions
function main() function main()
{ {
// Start the page // 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->db = $db;
$this->config = $config; $this->config = $config;

View file

@ -27,7 +27,7 @@ class acp_forums
function main($id, $mode) function main($id, $mode)
{ {
global $db, $user, $auth, $template, $cache, $request, $phpbb_dispatcher; 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'); $user->add_lang('acp/forums');
$this->tpl_name = 'acp_forums'; $this->tpl_name = 'acp_forums';

View file

@ -26,7 +26,7 @@ class acp_groups
function main($id, $mode) function main($id, $mode)
{ {
global $config, $db, $user, $auth, $template, $cache; 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; global $request, $phpbb_container, $phpbb_dispatcher;
$user->add_lang('acp/groups'); $user->add_lang('acp/groups');

View file

@ -28,8 +28,8 @@ class acp_icons
function main($id, $mode) function main($id, $mode)
{ {
global $db, $user, $auth, $template, $cache, $phpbb_container; global $db, $user, $template, $cache;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; global $config, $phpbb_root_path;
global $request, $phpbb_container; global $request, $phpbb_container;
$user->add_lang('acp/posting'); $user->add_lang('acp/posting');

View file

@ -32,7 +32,7 @@ class acp_inactive
function main($id, $mode) function main($id, $mode)
{ {
global $config, $db, $user, $auth, $template, $phpbb_container, $phpbb_log, $request; 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')) if (!function_exists('user_active_flip'))
{ {

View file

@ -29,8 +29,8 @@ class acp_jabber
function main($id, $mode) function main($id, $mode)
{ {
global $db, $user, $auth, $template, $phpbb_log, $request; global $db, $user, $template, $phpbb_log, $request;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; global $config, $phpbb_root_path, $phpEx;
$user->add_lang('acp/board'); $user->add_lang('acp/board');
@ -39,7 +39,6 @@ class acp_jabber
include($phpbb_root_path . 'includes/functions_jabber.' . $phpEx); include($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
} }
$action = $request->variable('action', '');
$submit = (isset($_POST['submit'])) ? true : false; $submit = (isset($_POST['submit'])) ? true : false;
if ($mode != 'settings') 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); trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING);
} }
$error = array();
$message = $user->lang['JAB_SETTINGS_CHANGED']; $message = $user->lang['JAB_SETTINGS_CHANGED'];
$log = 'JAB_SETTINGS_CHANGED'; $log = 'JAB_SETTINGS_CHANGED';

View file

@ -25,8 +25,8 @@ class acp_logs
function main($id, $mode) function main($id, $mode)
{ {
global $db, $user, $auth, $template, $cache, $phpbb_container; global $user, $auth, $template, $phpbb_container;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; global $config;
global $request; global $request;
$user->add_lang('mcp'); $user->add_lang('mcp');
@ -34,7 +34,6 @@ class acp_logs
// Set up general vars // Set up general vars
$action = $request->variable('action', ''); $action = $request->variable('action', '');
$forum_id = $request->variable('f', 0); $forum_id = $request->variable('f', 0);
$topic_id = $request->variable('t', 0);
$start = $request->variable('start', 0); $start = $request->variable('start', 0);
$deletemark = $request->variable('delmarked', false, false, \phpbb\request\request_interface::POST); $deletemark = $request->variable('delmarked', false, false, \phpbb\request\request_interface::POST);
$deleteall = $request->variable('delall', false, false, \phpbb\request\request_interface::POST); $deleteall = $request->variable('delall', false, false, \phpbb\request\request_interface::POST);

View file

@ -26,8 +26,8 @@ class acp_permission_roles
function main($id, $mode) function main($id, $mode)
{ {
global $db, $user, $auth, $template, $cache, $phpbb_container; global $db, $user, $template, $phpbb_container;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; global $phpbb_root_path, $phpEx;
global $request, $phpbb_log; global $request, $phpbb_log;
if (!function_exists('user_get_id_name')) if (!function_exists('user_get_id_name'))

View file

@ -31,8 +31,8 @@ class acp_permissions
function main($id, $mode) function main($id, $mode)
{ {
global $db, $user, $auth, $template, $cache, $phpbb_container, $request; global $db, $user, $auth, $template, $phpbb_container, $request;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; global $config, $phpbb_root_path, $phpEx;
if (!function_exists('user_get_id_name')) if (!function_exists('user_get_id_name'))
{ {
@ -167,8 +167,6 @@ class acp_permissions
} }
// Define some common variables for every mode // Define some common variables for every mode
$error = array();
$permission_scope = (strpos($mode, '_global') !== false) ? 'global' : 'local'; $permission_scope = (strpos($mode, '_global') !== false) ? 'global' : 'local';
// Showing introductionary page? // Showing introductionary page?

View file

@ -25,8 +25,7 @@ class acp_php_info
function main($id, $mode) function main($id, $mode)
{ {
global $db, $user, $auth, $template; global $template;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
if ($mode != 'info') if ($mode != 'info')
{ {

View file

@ -33,8 +33,8 @@ class acp_profile
function main($id, $mode) function main($id, $mode)
{ {
global $config, $db, $user, $auth, $template, $cache; global $config, $db, $user, $template;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; global $phpbb_root_path, $phpEx;
global $request, $phpbb_container, $phpbb_log, $phpbb_dispatcher; global $request, $phpbb_container, $phpbb_log, $phpbb_dispatcher;
if (!function_exists('generate_smilies')) if (!function_exists('generate_smilies'))
@ -55,7 +55,6 @@ class acp_profile
$action = (isset($_POST['create'])) ? 'create' : $request->variable('action', ''); $action = (isset($_POST['create'])) ? 'create' : $request->variable('action', '');
$error = array(); $error = array();
$s_hidden_fields = '';
if (!$field_id && in_array($action, array('delete','activate', 'deactivate', 'move_up', 'move_down', 'edit'))) if (!$field_id && in_array($action, array('delete','activate', 'deactivate', 'move_up', 'move_down', 'edit')))
{ {

View file

@ -25,7 +25,7 @@ class acp_prune
function main($id, $mode) function main($id, $mode)
{ {
global $user, $phpEx, $phpbb_admin_path, $phpbb_root_path; global $user, $phpEx, $phpbb_root_path;
$user->add_lang('acp/prune'); $user->add_lang('acp/prune');
@ -55,8 +55,7 @@ class acp_prune
*/ */
function prune_forums($id, $mode) function prune_forums($id, $mode)
{ {
global $db, $user, $auth, $template, $cache, $phpbb_log, $request; global $db, $user, $auth, $template, $phpbb_log, $request;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$all_forums = $request->variable('all_forums', 0); $all_forums = $request->variable('all_forums', 0);
$forum_id = $request->variable('f', array(0)); $forum_id = $request->variable('f', array(0));

View file

@ -25,8 +25,8 @@ class acp_ranks
function main($id, $mode) function main($id, $mode)
{ {
global $db, $user, $auth, $template, $cache, $request, $phpbb_dispatcher; global $db, $user, $template, $cache, $request, $phpbb_dispatcher;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_log; global $config, $phpbb_root_path, $phpbb_admin_path, $phpbb_log;
$user->add_lang('acp/posting'); $user->add_lang('acp/posting');
@ -162,7 +162,7 @@ class acp_ranks
case 'edit': case 'edit':
case 'add': case 'add':
$data = $ranks = $existing_imgs = array(); $ranks = $existing_imgs = array();
$sql = 'SELECT * $sql = 'SELECT *
FROM ' . RANKS_TABLE . ' FROM ' . RANKS_TABLE . '

View file

@ -25,8 +25,7 @@ class acp_reasons
function main($id, $mode) function main($id, $mode)
{ {
global $db, $user, $auth, $template, $cache; global $db, $user, $template;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
global $request, $phpbb_log; global $request, $phpbb_log;
$user->add_lang(array('mcp', 'acp/posting')); $user->add_lang(array('mcp', 'acp/posting'));

View file

@ -50,8 +50,8 @@ class acp_search
function settings($id, $mode) function settings($id, $mode)
{ {
global $db, $user, $auth, $template, $cache, $phpbb_log, $request; global $user, $template, $phpbb_log, $request;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; global $config, $phpbb_admin_path, $phpEx;
$submit = (isset($_POST['submit'])) ? true : false; $submit = (isset($_POST['submit'])) ? true : false;

View file

@ -31,8 +31,8 @@ class acp_users
function main($id, $mode) function main($id, $mode)
{ {
global $config, $db, $user, $auth, $template, $cache; global $config, $db, $user, $auth, $template;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads; global $phpbb_root_path, $phpbb_admin_path, $phpEx;
global $phpbb_dispatcher, $request; global $phpbb_dispatcher, $request;
global $phpbb_container, $phpbb_log; global $phpbb_container, $phpbb_log;

View file

@ -28,8 +28,7 @@ class acp_words
function main($id, $mode) function main($id, $mode)
{ {
global $db, $user, $auth, $template, $cache, $phpbb_log, $request, $phpbb_container; global $db, $user, $template, $cache, $phpbb_log, $request, $phpbb_container;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('acp/posting'); $user->add_lang('acp/posting');

View file

@ -140,7 +140,7 @@ class bbcode
*/ */
function bbcode_cache_init() 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)) if (empty($this->template_filename))
{ {

View file

@ -24,7 +24,7 @@ if (!defined('IN_PHPBB'))
*/ */
function adm_page_header($page_title) 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_root_path, $phpbb_admin_path, $phpEx, $SID, $_SID;
global $phpbb_dispatcher; global $phpbb_dispatcher;
@ -140,8 +140,8 @@ function adm_page_header($page_title)
*/ */
function adm_page_footer($copyright_html = true) function adm_page_footer($copyright_html = true)
{ {
global $db, $config, $template, $user, $auth, $cache; global $db, $config, $template, $user, $auth;
global $starttime, $phpbb_root_path, $phpbb_admin_path, $phpEx; global $phpbb_root_path;
global $request, $phpbb_dispatcher; global $request, $phpbb_dispatcher;
// A listener can set this variable to `true` when it overrides this function // A listener can set this variable to `true` when it overrides this function

View file

@ -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) 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 // 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 $sql = 'SELECT forum_id, forum_name, parent_id, forum_type, forum_flags, forum_options, left_id, right_id

View file

@ -56,7 +56,6 @@ class compress
// Clean up path, add closing / if not present // Clean up path, add closing / if not present
$src_path = ($src_path && substr($src_path, -1) != '/') ? $src_path . '/' : $src_path; $src_path = ($src_path && substr($src_path, -1) != '/') ? $src_path . '/' : $src_path;
$filelist = array();
$filelist = filelist("$phpbb_root_path$src", '', '*'); $filelist = filelist("$phpbb_root_path$src", '', '*');
krsort($filelist); krsort($filelist);

View file

@ -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(); $forum_rows = $subforums = $forum_ids = $forum_ids_moderator = $forum_moderators = $active_forum_ary = array();
$parent_id = $visible_forums = 0; $parent_id = $visible_forums = 0;
$sql_from = '';
// Mark forums read? // Mark forums read?
$mark_read = $request->variable('mark', ''); $mark_read = $request->variable('mark', '');

View file

@ -123,7 +123,7 @@ function wrap_img_in_html($src, $title)
*/ */
function send_file_to_browser($attachment, $upload_dir, $category) 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']; $filename = $phpbb_root_path . $upload_dir . '/' . $attachment['physical_filename'];

View file

@ -82,8 +82,8 @@ class p_master
*/ */
function list_modules($p_class) function list_modules($p_class)
{ {
global $auth, $db, $user, $cache; global $db, $user, $cache;
global $config, $phpbb_root_path, $phpEx, $phpbb_dispatcher; global $phpbb_dispatcher;
// Sanitise for future path use, it's escaped as appropriate for queries // Sanitise for future path use, it's escaped as appropriate for queries
$this->p_class = str_replace(array('.', '/', '\\'), '', basename($p_class)); $this->p_class = str_replace(array('.', '/', '\\'), '', basename($p_class));

View file

@ -166,7 +166,7 @@ function user_update_name($old_name, $new_name)
*/ */
function user_add($user_row, $cp_data = false, $notifications_data = null) 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; 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'])) if (empty($user_row['username']) || !isset($user_row['group_id']) || !isset($user_row['user_email']) || !isset($user_row['user_type']))

View file

@ -24,7 +24,7 @@ if (!defined('IN_PHPBB'))
*/ */
function mcp_front_view($id, $mode, $action) 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 $template, $db, $user, $auth, $module;
global $phpbb_dispatcher, $request; global $phpbb_dispatcher, $request;

View file

@ -36,7 +36,7 @@ class mcp_logs
function main($id, $mode) function main($id, $mode)
{ {
global $auth, $db, $user, $template, $request; 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'); $user->add_lang('acp/common');

View file

@ -35,8 +35,8 @@ class mcp_main
function main($id, $mode) function main($id, $mode)
{ {
global $auth, $db, $user, $template, $action; global $auth, $user, $action;
global $config, $phpbb_root_path, $phpEx, $request; global $phpbb_root_path, $phpEx, $request;
global $phpbb_dispatcher; global $phpbb_dispatcher;
$quickmod = ($mode == 'quickmod') ? true : false; $quickmod = ($mode == 'quickmod') ? true : false;

View file

@ -35,8 +35,8 @@ class mcp_notes
function main($id, $mode) function main($id, $mode)
{ {
global $auth, $db, $user, $template, $request; global $user, $template, $request;
global $config, $phpbb_root_path, $phpEx; global $phpbb_root_path, $phpEx;
$action = $request->variable('action', array('' => '')); $action = $request->variable('action', array('' => ''));
@ -74,7 +74,7 @@ class mcp_notes
*/ */
function mcp_notes_user_view($action) 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; global $template, $db, $user, $auth, $phpbb_container;
$user_id = $request->variable('u', 0); $user_id = $request->variable('u', 0);

View file

@ -35,7 +35,7 @@ class mcp_pm_reports
function main($id, $mode) 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 $config, $phpbb_root_path, $phpEx, $action, $phpbb_container;
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);

View file

@ -128,7 +128,6 @@ function mcp_post_details($id, $mode, $action)
$users_ary = $usernames_ary = array(); $users_ary = $usernames_ary = array();
$attachments = $extensions = array(); $attachments = $extensions = array();
$post_id = $post_info['post_id']; $post_id = $post_info['post_id'];
$topic_tracking_info = array();
// Get topic tracking info // Get topic tracking info
if ($config['load_db_lastread']) 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'])) 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 * $sql = 'SELECT *
FROM ' . ATTACHMENTS_TABLE . ' FROM ' . ATTACHMENTS_TABLE . '
WHERE post_msg_id = ' . $post_id . ' WHERE post_msg_id = ' . $post_id . '

View file

@ -35,7 +35,7 @@ class mcp_reports
function main($id, $mode) 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; global $config, $phpbb_root_path, $phpEx, $action, $phpbb_container, $phpbb_dispatcher;
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);

View file

@ -156,8 +156,6 @@ function mcp_topic_view($id, $mode, $action)
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$topic_tracking_info = array();
// Get topic tracking info // Get topic tracking info
if ($config['load_db_lastread']) if ($config['load_db_lastread'])
{ {

View file

@ -35,8 +35,7 @@ class mcp_warn
function main($id, $mode) function main($id, $mode)
{ {
global $auth, $db, $user, $template, $request; global $request;
global $config, $phpbb_root_path, $phpEx;
$action = $request->variable('action', array('' => '')); $action = $request->variable('action', array('' => ''));
@ -78,8 +77,8 @@ class mcp_warn
*/ */
function mcp_warn_front_view() function mcp_warn_front_view()
{ {
global $phpEx, $phpbb_root_path, $config; global $phpEx, $phpbb_root_path;
global $template, $db, $user, $auth; global $template, $db, $user;
$template->assign_vars(array( $template->assign_vars(array(
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=mcp&amp;field=username&amp;select_single=true'), 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=mcp&amp;field=username&amp;select_single=true'),
@ -132,7 +131,7 @@ class mcp_warn
function mcp_warn_list_view($action) function mcp_warn_list_view($action)
{ {
global $phpEx, $phpbb_root_path, $config, $phpbb_container; global $phpEx, $phpbb_root_path, $config, $phpbb_container;
global $template, $db, $user, $auth, $request; global $template, $user, $auth, $request;
/* @var $pagination \phpbb\pagination */ /* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination'); $pagination = $phpbb_container->get('pagination');

View file

@ -30,7 +30,7 @@ class ucp_activate
function main($id, $mode) function main($id, $mode)
{ {
global $config, $phpbb_root_path, $phpEx, $request; 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); $user_id = $request->variable('u', 0);
$key = $request->variable('k', ''); $key = $request->variable('k', '');

View file

@ -36,7 +36,6 @@ class ucp_attachments
$sort_dir = $request->variable('sd', 'a'); $sort_dir = $request->variable('sd', 'a');
$delete = (isset($_POST['delete'])) ? true : false; $delete = (isset($_POST['delete'])) ? true : false;
$confirm = (isset($_POST['confirm'])) ? true : false;
$delete_ids = array_keys($request->variable('attachment', array(0))); $delete_ids = array_keys($request->variable('attachment', array(0)));
if ($delete && sizeof($delete_ids)) if ($delete && sizeof($delete_ids))

View file

@ -36,7 +36,7 @@ class ucp_confirm
function main($id, $mode) 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 = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']);
$captcha->init($request->variable('type', 0)); $captcha->init($request->variable('type', 0));

View file

@ -38,8 +38,6 @@ class ucp_groups
$mark_ary = $request->variable('mark', array(0)); $mark_ary = $request->variable('mark', array(0));
$submit = $request->variable('submit', false, false, \phpbb\request\request_interface::POST); $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 */ /** @var \phpbb\group\helper $group_helper */
$group_helper = $phpbb_container->get('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); 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')); $user->add_lang(array('acp/groups', 'acp/common'));
$data = $submit_ary = array();
$update = (isset($_POST['update'])) ? true : false; $update = (isset($_POST['update'])) ? true : false;
$error = array(); $error = array();

View file

@ -99,7 +99,7 @@ class ucp_login_link
else else
{ {
// Finish login // 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 // Perform a redirect as the account has been linked
$this->perform_redirect(); $this->perform_redirect();

View file

@ -24,7 +24,7 @@ if (!defined('IN_PHPBB'))
*/ */
function message_options($id, $mode, $global_privmsgs_rules, $global_rule_conditions) 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&amp;mode=options"); $redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&amp;mode=options");
@ -80,7 +80,6 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
if (check_form_key('ucp_pm_options')) if (check_form_key('ucp_pm_options'))
{ {
$folder_name = $request->variable('foldername', '', true); $folder_name = $request->variable('foldername', '', true);
$msg = '';
if ($folder_name) if ($folder_name)
{ {

View file

@ -41,9 +41,6 @@ function view_folder($id, $mode, $folder_id, $folder)
$color_rows = array('marked', 'replied'); $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 = new p_master();
$_module->list_modules('ucp'); $_module->list_modules('ucp');
$_module->set_active('zebra'); $_module->set_active('zebra');

View file

@ -51,7 +51,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
} }
// Grab icons // Grab icons
$icons = $cache->obtain_icons(); $cache->obtain_icons();
// Load the custom profile fields // Load the custom profile fields
if ($config['load_cpf_pm']) if ($config['load_cpf_pm'])

View file

@ -29,7 +29,7 @@ class ucp_prefs
function main($id, $mode) 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; $submit = (isset($_POST['submit'])) ? true : false;
$error = $data = array(); $error = $data = array();

View file

@ -31,13 +31,12 @@ class ucp_profile
function main($id, $mode) 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; global $request, $phpbb_container, $phpbb_log, $phpbb_dispatcher;
$user->add_lang('posting'); $user->add_lang('posting');
$submit = $request->variable('submit', false, false, \phpbb\request\request_interface::POST); $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(); $error = $data = array();
$s_hidden_fields = ''; $s_hidden_fields = '';

View file

@ -29,7 +29,7 @@ class ucp_register
function main($id, $mode) 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; global $request, $phpbb_container, $phpbb_dispatcher;
// //

View file

@ -30,7 +30,7 @@ class ucp_remind
function main($id, $mode) function main($id, $mode)
{ {
global $config, $phpbb_root_path, $phpEx, $request; 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']) if (!$config['allow_password_reset'])
{ {

View file

@ -25,7 +25,7 @@ class ucp_zebra
function main($id, $mode) 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; $submit = (isset($_POST['submit']) || isset($_GET['add']) || isset($_GET['remove'])) ? true : false;
$s_hidden_fields = ''; $s_hidden_fields = '';

View file

@ -54,7 +54,7 @@ function phpbb_forum_flags()
*/ */
function phpbb_insert_forums() 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); $db->sql_query($convert->truncate_statement . FORUMS_TABLE);

View file

@ -97,13 +97,12 @@ class gd
if ($config['captcha_gd_3d_noise']) if ($config['captcha_gd_3d_noise'])
{ {
$xoffset = mt_rand(0,9);
$noise_bitmaps = $this->captcha_noise_bg_bitmaps(); $noise_bitmaps = $this->captcha_noise_bg_bitmaps();
for ($i = 0; $i < $code_len; ++$i) for ($i = 0; $i < $code_len; ++$i)
{ {
$noise[$i] = new char_cube3d($noise_bitmaps, mt_rand(1, sizeof($noise_bitmaps['data']))); $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]); //$box = $noise[$i]->dimensions($sizes[$i]);
} }
$xoffset = 0; $xoffset = 0;
@ -151,8 +150,6 @@ class gd
*/ */
function wave($img) function wave($img)
{ {
global $config;
$period_x = mt_rand(12,18); $period_x = mt_rand(12,18);
$period_y = mt_rand(7,14); $period_y = mt_rand(7,14);
$amp_x = mt_rand(5,10); $amp_x = mt_rand(5,10);

View file

@ -23,8 +23,6 @@ class gd_wave
function execute($code, $seed) function execute($code, $seed)
{ {
global $starttime;
// seed the random generator // seed the random generator
mt_srand($seed); mt_srand($seed);
@ -77,7 +75,6 @@ class gd_wave
// TODO // TODO
$background = imagecolorallocate($img, mt_rand(155, 255), mt_rand(155, 255), mt_rand(155, 255)); $background = imagecolorallocate($img, mt_rand(155, 255), mt_rand(155, 255), mt_rand(155, 255));
imagefill($img, 0, 0, $background); imagefill($img, 0, 0, $background);
$black = imagecolorallocate($img, 0, 0, 0);
$random = array(); $random = array();
$fontcolors = array(); $fontcolors = array();
@ -155,7 +152,7 @@ class gd_wave
// rather than recalculating from absolute coordinates // rather than recalculating from absolute coordinates
// What we cache into the $img_buffer contains the raised text 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']); $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_x = $plane_x * $subdivision_factor;
$full_y = $plane_y * $subdivision_factor; $full_y = $plane_y * $subdivision_factor;

View file

@ -34,7 +34,7 @@ abstract class captcha_abstract
function init($type) function init($type)
{ {
global $config, $db, $user, $request; global $config, $request;
// read input // read input
$this->confirm_id = $request->variable('confirm_id', ''); $this->confirm_id = $request->variable('confirm_id', '');
@ -56,8 +56,6 @@ abstract class captcha_abstract
function execute_demo() function execute_demo()
{ {
global $user;
$this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS)); $this->code = gen_rand_string_friendly(mt_rand(CAPTCHA_MIN_CHARS, CAPTCHA_MAX_CHARS));
$this->seed = hexdec(substr(unique_id(), 4, 10)); $this->seed = hexdec(substr(unique_id(), 4, 10));
@ -117,7 +115,7 @@ abstract class captcha_abstract
function get_demo_template($id) function get_demo_template($id)
{ {
global $config, $user, $template, $request, $phpbb_admin_path, $phpEx; global $config, $template, $request, $phpbb_admin_path, $phpEx;
$variables = ''; $variables = '';
@ -153,7 +151,7 @@ abstract class captcha_abstract
function garbage_collect($type) function garbage_collect($type)
{ {
global $db, $config; global $db;
$sql = 'SELECT DISTINCT c.session_id $sql = 'SELECT DISTINCT c.session_id
FROM ' . CONFIRM_TABLE . ' c FROM ' . CONFIRM_TABLE . ' c

View file

@ -53,18 +53,11 @@ class gd extends captcha_abstract
function acp_page($id, &$module) function acp_page($id, &$module)
{ {
global $db, $user, $auth, $template, $phpbb_log, $request; global $user, $template, $phpbb_log, $request;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; global $config;
$user->add_lang('acp/board'); $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->tpl_name = 'captcha_gd_acp';
$module->page_title = 'ACP_VC_SETTINGS'; $module->page_title = 'ACP_VC_SETTINGS';
$form_key = 'acp_captcha'; $form_key = 'acp_captcha';

View file

@ -35,7 +35,7 @@ class gd_wave extends captcha_abstract
function acp_page($id, &$module) 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)); trigger_error($user->lang['CAPTCHA_NO_OPTIONS'] . adm_back_link($module->u_action));
} }

View file

@ -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 * but I assume its because the Oracle extension provides a direct method to access it
* without a query. * without a query.
*/ */
$use_cache = false;
/* /*
global $cache; global $cache;

View file

@ -118,7 +118,7 @@ class release_3_0_5_rc1 extends container_aware_migration
$result = $this->db->sql_query($sql); $result = $this->db->sql_query($sql);
// Skip first row, this is our original auth option we want to preserve // 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)) while ($row = $this->db->sql_fetchrow($result))
{ {

View file

@ -45,7 +45,6 @@ class update_custom_bbcodes_with_idn extends \phpbb\db\migration\migration
$sql_ary = array(); $sql_ary = array();
while ($row = $this->db->sql_fetchrow($result)) while ($row = $this->db->sql_fetchrow($result))
{ {
$data = array();
if (preg_match('/(URL|LOCAL_URL|RELATIVE_URL)/', $row['bbcode_match'])) if (preg_match('/(URL|LOCAL_URL|RELATIVE_URL)/', $row['bbcode_match']))
{ {
$data = $bbcodes->build_regexp($row['bbcode_match'], $row['bbcode_tpl']); $data = $bbcodes->build_regexp($row['bbcode_match'], $row['bbcode_tpl']);

View file

@ -97,7 +97,6 @@ class remote extends base
$url['path'] = implode('', $url['path']); $url['path'] = implode('', $url['path']);
$upload_ary['name'] = utf8_basename($url['path']) . (($ext) ? '.' . $ext : ''); $upload_ary['name'] = utf8_basename($url['path']) . (($ext) ? '.' . $ext : '');
$filename = $url['path'];
$filesize = 0; $filesize = 0;
$remote_max_filesize = $this->get_max_file_size(); $remote_max_filesize = $this->get_max_file_size();

View file

@ -117,7 +117,7 @@ class validate extends \phpbb\console\command\command
try try
{ {
$config = $processor->processConfiguration($configuration, $config); $processor->processConfiguration($configuration, $config);
} }
catch (Exception $e) catch (Exception $e)
{ {

View file

@ -19,7 +19,6 @@ use phpbb\install\helper\navigation\navigation_provider;
use Symfony\Component\HttpFoundation\StreamedResponse; use Symfony\Component\HttpFoundation\StreamedResponse;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use phpbb\install\helper\iohandler\factory; use phpbb\install\helper\iohandler\factory;
use phpbb\install\controller\helper;
use phpbb\template\template; use phpbb\template\template;
use phpbb\request\request_interface; use phpbb\request\request_interface;
use phpbb\install\installer; use phpbb\install\installer;

View file

@ -66,7 +66,7 @@ class report_handler_post extends report_handler
'reported_post_enable_magic_url' => $this->report_data['enable_magic_url'], '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 . ' $sql = 'UPDATE ' . POSTS_TABLE . '
SET post_reported = 1 SET post_reported = 1

View file

@ -28,8 +28,6 @@ class includejs extends \phpbb\template\twig\node\includeasset
*/ */
protected function append_asset(\Twig_Compiler $compiler) protected function append_asset(\Twig_Compiler $compiler)
{ {
$config = $this->environment->get_phpbb_config();
$compiler $compiler
->raw("<script type=\"text/javascript\" src=\"' . ") ->raw("<script type=\"text/javascript\" src=\"' . ")
->raw("\$asset_file") ->raw("\$asset_file")

View file

@ -50,7 +50,6 @@ class parser implements \phpbb\textformatter\parser_interface
$this->dispatcher = $dispatcher; $this->dispatcher = $dispatcher;
$this->parser = $parser; $this->parser = $parser;
$parser = $this;
/** /**
* Configure the parser service * Configure the parser service
@ -73,8 +72,6 @@ class parser implements \phpbb\textformatter\parser_interface
*/ */
public function parse($text) public function parse($text)
{ {
$parser = $this;
/** /**
* Modify a text before it is parsed * Modify a text before it is parsed
* *

View file

@ -104,7 +104,6 @@ class renderer implements \phpbb\textformatter\renderer_interface
} }
$this->dispatcher = $dispatcher; $this->dispatcher = $dispatcher;
$this->renderer = $renderer; $this->renderer = $renderer;
$renderer = $this;
/** /**
* Configure the renderer service * Configure the renderer service