aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/acp/acp_attachments.php3
-rw-r--r--phpBB/includes/acp/acp_board.php8
-rw-r--r--phpBB/includes/acp/acp_forums.php2
-rw-r--r--phpBB/includes/acp/acp_groups.php3
-rw-r--r--phpBB/includes/acp/acp_permissions.php2
-rw-r--r--phpBB/includes/acp/acp_prune.php1
-rw-r--r--phpBB/includes/acp/acp_users.php13
-rw-r--r--phpBB/includes/acp/auth.php4
-rw-r--r--phpBB/includes/functions.php22
-rw-r--r--phpBB/includes/functions_admin.php4
-rw-r--r--phpBB/includes/functions_content.php2
-rw-r--r--phpBB/includes/functions_convert.php22
-rw-r--r--phpBB/includes/functions_display.php4
-rw-r--r--phpBB/includes/functions_messenger.php6
-rw-r--r--phpBB/includes/functions_posting.php8
-rw-r--r--phpBB/includes/functions_privmsgs.php15
-rw-r--r--phpBB/includes/functions_user.php19
-rw-r--r--phpBB/includes/mcp/mcp_main.php2
-rw-r--r--phpBB/includes/mcp/mcp_post.php2
-rw-r--r--phpBB/includes/mcp/mcp_queue.php11
-rw-r--r--phpBB/includes/mcp/mcp_reports.php2
-rw-r--r--phpBB/includes/mcp/mcp_topic.php2
-rw-r--r--phpBB/includes/message_parser.php8
-rw-r--r--phpBB/includes/sphinxapi.php1
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php1
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewmessage.php2
-rw-r--r--phpBB/includes/utf/utf_tools.php2
-rw-r--r--phpBB/install/convertors/functions_phpbb20.php16
-rw-r--r--phpBB/phpbb/db/driver/driver.php2
-rw-r--r--phpBB/phpbb/request/type_cast_helper.php1
-rw-r--r--phpBB/phpbb/search/fulltext_native.php2
-rw-r--r--phpBB/phpbb/session.php6
32 files changed, 64 insertions, 134 deletions
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php
index 32bc6b3152..6e9360f599 100644
--- a/phpBB/includes/acp/acp_attachments.php
+++ b/phpBB/includes/acp/acp_attachments.php
@@ -1570,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.*'";
}
@@ -1583,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.*'";
}
@@ -1596,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_board.php b/phpBB/includes/acp/acp_board.php
index 9febbb631d..26663d2a62 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -939,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'] . '" />';
@@ -1050,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
@@ -1069,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
@@ -1126,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_forums.php b/phpBB/includes/acp/acp_forums.php
index 0bd3adee3d..490f91273b 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -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']}";
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index bdeac3cd9d..1f965b334c 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -1092,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']);
@@ -1130,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)
@@ -1173,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_permissions.php b/phpBB/includes/acp/acp_permissions.php
index 6e0c17e10c..fdac7c4d00 100644
--- a/phpBB/includes/acp/acp_permissions.php
+++ b/phpBB/includes/acp/acp_permissions.php
@@ -690,8 +690,6 @@ class acp_permissions
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- $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_prune.php b/phpBB/includes/acp/acp_prune.php
index d27d81f396..d37050869a 100644
--- a/phpBB/includes/acp/acp_prune.php
+++ b/phpBB/includes/acp/acp_prune.php
@@ -440,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_users.php b/phpBB/includes/acp/acp_users.php
index 02e552ea17..10a6870586 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -1268,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');
+ $marked = $request->variable('mark', array(0));;
// Delete entries if requested and able
if ($deletemark || $deleteall || $confirm)
@@ -2293,10 +2286,6 @@ class acp_users
trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
}
- else
- {
- $founder_manage = 0;
- }
switch ($action)
{
diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php
index a60c091149..11478842d7 100644
--- a/phpBB/includes/acp/auth.php
+++ b/phpBB/includes/acp/auth.php
@@ -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/functions.php b/phpBB/includes/functions.php
index 2a891bcbac..f6b7a7d2a9 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)
@@ -1719,9 +1719,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 +2239,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 +3211,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 +3543,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 +3609,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 +4005,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 +4556,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 +4697,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_admin.php b/phpBB/includes/functions_admin.php
index 37a752174a..1c7e68d358 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -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_content.php b/phpBB/includes/functions_content.php
index 4ad45a5a2e..719e961474 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -1054,7 +1054,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 = '';
@@ -1096,7 +1095,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)
diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php
index 063a4afcd3..39d377af68 100644
--- a/phpBB/includes/functions_convert.php
+++ b/phpBB/includes/functions_convert.php
@@ -905,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;
@@ -1120,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,
@@ -1140,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')))
{
@@ -1196,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')
@@ -1275,7 +1275,7 @@ function get_config()
*/
function restore_config($schema)
{
- global $db, $config;
+ global $config;
$convert_config = get_config();
@@ -2037,7 +2037,7 @@ function update_dynamic_config()
*/
function update_topics_posted()
{
- global $db, $config;
+ global $db;
switch ($db->get_sql_layer())
{
@@ -2178,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
@@ -2201,7 +2201,7 @@ function remove_invalid_users()
function convert_bbcode($message, $convert_size = true, $extended_bbcodes = false)
{
- static $orig, $repl, $origx, $replx, $str_from, $str_to;
+ static $orig, $repl, $origx, $replx;
if (empty($orig))
{
@@ -2314,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;
@@ -2371,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;
@@ -2483,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 7eb800167b..3e5d85c99c 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -886,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();
@@ -1002,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'];
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index 1071917c21..1733e18dae 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -452,7 +452,7 @@ class messenger
*/
function msg_email()
{
- global $config, $user;
+ global $config;
if (empty($config['email_enable']))
{
@@ -1257,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;
@@ -1735,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_posting.php b/phpBB/includes/functions_posting.php
index 3addf0ddb4..22a98411ad 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -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
@@ -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 2a2083ce2a..08fc3b4a02 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -940,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))
{
@@ -1005,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;
@@ -1175,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)
@@ -1196,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);
@@ -1575,7 +1572,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]))
{
@@ -1608,7 +1605,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')
@@ -1762,8 +1759,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));
@@ -1964,7 +1959,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_user.php b/phpBB/includes/functions_user.php
index 952b4b444b..7bc6ab6a8a 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -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.*";
}
@@ -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_main.php b/phpBB/includes/mcp/mcp_main.php
index 638749985a..ee9ca1122d 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -875,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
diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php
index d4340899cd..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');
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index be5a4571ed..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;
@@ -400,7 +400,6 @@ class mcp_queue
trigger_error('NOT_MODERATOR');
}
- $forum_info = $forum_info[$forum_id];
$forum_list = $forum_id;
}
@@ -873,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')))
@@ -1070,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')))
@@ -1082,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,
@@ -1140,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 065cf7a50e..48d0e8d890 100644
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -367,7 +367,6 @@ class mcp_reports
trigger_error('NOT_MODERATOR');
}
- $forum_info = $forum_info[$forum_id];
$forum_list = array($forum_id);
}
@@ -457,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(
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index a72ad94b54..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());
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index 935793a810..97e0dd9f0d 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -1007,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)));
@@ -1153,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;
@@ -1768,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);
@@ -1856,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/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_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 955dd4aa9e..e707c251fe 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -1052,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_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php
index a0f5e6507f..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'));
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 f069698b2c..0be4346c1e 100644
--- a/phpBB/install/convertors/functions_phpbb20.php
+++ b/phpBB/install/convertors/functions_phpbb20.php
@@ -1218,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)
{
@@ -1248,9 +1248,6 @@ function phpbb_prepare_message($message)
$message = str_replace('\&quot;', '&quot;', $message);
}
- // Already the new user id ;)
- $user_id = $convert->row['poster_id'];
-
$message = str_replace('<br />', "\n", $message);
$message = str_replace('<', '&lt;', $message);
$message = str_replace('>', '&gt;', $message);
@@ -1608,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);
}
@@ -1656,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)
{
@@ -1762,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':
@@ -1853,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
@@ -1966,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/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/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 3bc7b91ec2..07dfa3e066 100644
--- a/phpBB/phpbb/search/fulltext_native.php
+++ b/phpBB/phpbb/search/fulltext_native.php
@@ -1733,7 +1733,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/session.php b/phpBB/phpbb/session.php
index ce51483aee..b8784a2f42 100644
--- a/phpBB/phpbb/session.php
+++ b/phpBB/phpbb/session.php
@@ -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))