[ticket/13454] Remove more unused variables

This should be the last part. Off to checking if the changes were correct.

PHPBB3-13454
This commit is contained in:
Marc Alexander 2015-12-05 16:07:14 +01:00
parent 3b9a9bb04a
commit 73900d1857
16 changed files with 17 additions and 27 deletions

View file

@ -1381,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)

View file

@ -1536,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>';

View file

@ -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

View file

@ -1312,8 +1312,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)

View file

@ -1320,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 . '
@ -1379,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();
@ -1490,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))

View file

@ -1292,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;

View file

@ -1291,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

View file

@ -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 */
@ -1359,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;

View file

@ -1391,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)

View file

@ -1289,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 . '

View file

@ -1344,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";

View file

@ -1299,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']))
{
@ -1320,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)
{
@ -1359,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/';

View file

@ -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]))

View file

@ -1324,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;

View file

@ -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_id,
'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;

View file

@ -196,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')
{