diff options
author | Gaëtan Muller <m.gaetan89@gmail.com> | 2015-01-04 20:41:04 +0100 |
---|---|---|
committer | Gaëtan Muller <m.gaetan89@gmail.com> | 2015-02-03 20:50:40 +0100 |
commit | f6e06da4c68917dafb057bf7fe19f884a3e148c2 (patch) | |
tree | e68e2c80b8588e066069a574ea7d0bda887c6ddd | |
parent | 284aa8c496d658c196a0dfa3c90657415ee4c2ee (diff) | |
download | forums-f6e06da4c68917dafb057bf7fe19f884a3e148c2.tar forums-f6e06da4c68917dafb057bf7fe19f884a3e148c2.tar.gz forums-f6e06da4c68917dafb057bf7fe19f884a3e148c2.tar.bz2 forums-f6e06da4c68917dafb057bf7fe19f884a3e148c2.tar.xz forums-f6e06da4c68917dafb057bf7fe19f884a3e148c2.zip |
[ticket/13455] Update calls to `request_var()`
PHPBB3-13455
93 files changed, 1061 insertions, 1068 deletions
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index 519f6c8310..7dc8e4b13d 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -50,8 +50,8 @@ define('IN_ADMIN', true); // Some oft used variables $safe_mode = (@ini_get('safe_mode') == '1' || strtolower(@ini_get('safe_mode')) === 'on') ? true : false; $file_uploads = (@ini_get('file_uploads') == '1' || strtolower(@ini_get('file_uploads')) === 'on') ? true : false; -$module_id = request_var('i', ''); -$mode = request_var('mode', ''); +$module_id = $request->variable('i', ''); +$mode = $request->variable('mode', ''); // Set custom style for admin area $template->set_custom_style(array( diff --git a/phpBB/cron.php b/phpBB/cron.php index 56e27ad9c1..e134dbbe4c 100644 --- a/phpBB/cron.php +++ b/phpBB/cron.php @@ -42,7 +42,7 @@ function output_image() // // Attempt to alleviate the problem by doing setup outside of the lock as much as possible. -$cron_type = request_var('cron_type', ''); +$cron_type = $request->variable('cron_type', ''); // Comment this line out for debugging so the page does not return an image. output_image(); diff --git a/phpBB/develop/fill.php b/phpBB/develop/fill.php index 6d08e9c206..2aaafe1e38 100644 --- a/phpBB/develop/fill.php +++ b/phpBB/develop/fill.php @@ -42,8 +42,8 @@ $posts_per_topic = 500; // general vars -$mode = request_var('mode', 'generate'); -$start = request_var('start', 0); +$mode = $request->variable('mode', 'generate'); +$start = $request->variable('start', 0); switch ($mode) { diff --git a/phpBB/develop/lang_duplicates.php b/phpBB/develop/lang_duplicates.php index 5981882292..7a74b1088a 100644 --- a/phpBB/develop/lang_duplicates.php +++ b/phpBB/develop/lang_duplicates.php @@ -29,7 +29,7 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1); $phpbb_root_path='./../'; include($phpbb_root_path . 'common.'.$phpEx); -$mode = request_var('mode', ''); +$mode = $request->variable('mode', ''); $modules = find_modules($phpbb_root_path . 'language/en'); diff --git a/phpBB/develop/update_email_hash.php b/phpBB/develop/update_email_hash.php index 57aebe3ca0..c149900d64 100644 --- a/phpBB/develop/update_email_hash.php +++ b/phpBB/develop/update_email_hash.php @@ -19,7 +19,7 @@ $user->session_begin(); $auth->acl($user->data); $user->setup(); -$start = request_var('start', 0); +$start = $request->variable('start', 0); $num_items = 1000; echo '<br />Updating user email hashes' . "\n"; diff --git a/phpBB/download/file.php b/phpBB/download/file.php index 26a76d8438..235dd3c95c 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -88,8 +88,6 @@ if (isset($_GET['avatar'])) unset($dbpasswd); - request_var('', 0, false, false, $request); - /* @var $config \phpbb\config\config */ $config = $phpbb_container->get('config'); @@ -103,7 +101,7 @@ if (isset($_GET['avatar'])) /* @var $phpbb_avatar_manager \phpbb\avatar\manager */ $phpbb_avatar_manager = $phpbb_container->get('avatar.manager'); - $filename = request_var('avatar', ''); + $filename = $request->variable('avatar', ''); $avatar_group = false; $exit = false; @@ -154,9 +152,9 @@ if (isset($_GET['avatar'])) include($phpbb_root_path . 'common.' . $phpEx); require($phpbb_root_path . 'includes/functions_download' . '.' . $phpEx); -$attach_id = request_var('id', 0); -$mode = request_var('mode', ''); -$thumbnail = request_var('t', false); +$attach_id = $request->variable('id', 0); +$mode = $request->variable('mode', ''); +$thumbnail = $request->variable('t', false); // Start session management, do not update session page. $user->session_begin(false); diff --git a/phpBB/faq.php b/phpBB/faq.php index 0b4aa33073..2a35205f44 100644 --- a/phpBB/faq.php +++ b/phpBB/faq.php @@ -24,7 +24,7 @@ $user->session_begin(); $auth->acl($user->data); $user->setup(); -$mode = request_var('mode', ''); +$mode = $request->variable('mode', ''); // Load the appropriate faq file switch ($mode) diff --git a/phpBB/feed.php b/phpBB/feed.php index 75877efd04..a7428ea846 100644 --- a/phpBB/feed.php +++ b/phpBB/feed.php @@ -33,11 +33,11 @@ if (!$config['feed_enable']) // Start session $user->session_begin(); -if (!empty($config['feed_http_auth']) && request_var('auth', '') == 'http') +if (!empty($config['feed_http_auth']) && $request->variable('auth', '') == 'http') { phpbb_http_login(array( 'auth_message' => 'Feed', - 'viewonline' => request_var('viewonline', true), + 'viewonline' => $request->variable('viewonline', true), )); } @@ -45,9 +45,9 @@ $auth->acl($user->data); $user->setup('viewtopic'); // Initial var setup -$forum_id = request_var('f', 0); -$topic_id = request_var('t', 0); -$mode = request_var('mode', ''); +$forum_id = $request->variable('f', 0); +$topic_id = $request->variable('t', 0); +$mode = $request->variable('mode', ''); // We do not use a template, therefore we simply define the global template variables here $global_vars = $item_vars = array(); @@ -162,7 +162,7 @@ if ($config['gzip_compress']) } // IF debug extra is enabled and admin want to "explain" the page we need to set other headers... -if (defined('DEBUG') && request_var('explain', 0) && $auth->acl_get('a_')) +if (defined('DEBUG') && $request->variable('explain', 0) && $auth->acl_get('a_')) { header('Content-type: text/html; charset=UTF-8'); header('Cache-Control: private, no-cache="set-cookie"'); diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index c3c152c32f..e5ade8a811 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -43,7 +43,7 @@ class acp_attachments function main($id, $mode) { global $db, $user, $auth, $template, $cache, $phpbb_container; - global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx, $phpbb_log; + global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx, $phpbb_log, $request; $this->id = $id; $this->db = $db; @@ -56,7 +56,7 @@ class acp_attachments $error = $notify = array(); $submit = (isset($_POST['submit'])) ? true : false; - $action = request_var('action', ''); + $action = $request->variable('action', ''); $form_key = 'acp_attach'; add_form_key($form_key); @@ -160,7 +160,7 @@ class acp_attachments ); $this->new_config = $config; - $cfg_array = (isset($_REQUEST['config'])) ? request_var('config', array('' => '')) : $this->new_config; + $cfg_array = (isset($_REQUEST['config'])) ? $request->variable('config', array('' => '')) : $this->new_config; $error = array(); // We validate the complete config if whished @@ -184,7 +184,7 @@ class acp_attachments if (in_array($config_name, array('attachment_quota', 'max_filesize', 'max_filesize_pm'))) { - $size_var = request_var($config_name, ''); + $size_var = $request->variable($config_name, ''); $this->new_config[$config_name] = $config_value = ($size_var == 'kb') ? round($config_value * 1024) : (($size_var == 'mb') ? round($config_value * 1048576) : $config_value); } @@ -334,8 +334,8 @@ class acp_attachments if ($submit) { // Change Extensions ? - $extension_change_list = request_var('extension_change_list', array(0)); - $group_select_list = request_var('group_select', array(0)); + $extension_change_list = $request->variable('extension_change_list', array(0)); + $group_select_list = $request->variable('group_select', array(0)); // Generate correct Change List $extensions = array(); @@ -365,7 +365,7 @@ class acp_attachments $db->sql_freeresult($result); // Delete Extension? - $extension_id_list = request_var('extension_id_list', array(0)); + $extension_id_list = $request->variable('extension_id_list', array(0)); if (sizeof($extension_id_list)) { @@ -391,8 +391,8 @@ class acp_attachments } // Add Extension? - $add_extension = strtolower(request_var('add_extension', '')); - $add_extension_group = request_var('add_group_select', 0); + $add_extension = strtolower($request->variable('add_extension', '')); + $add_extension_group = $request->variable('add_group_select', 0); $add = (isset($_POST['add_extension_check'])) ? true : false; if ($add_extension && $add) @@ -476,8 +476,8 @@ class acp_attachments if ($submit) { - $action = request_var('action', ''); - $group_id = request_var('g', 0); + $action = $request->variable('action', ''); + $group_id = $request->variable('g', 0); if ($action != 'add' && $action != 'edit') { @@ -508,7 +508,7 @@ class acp_attachments $ext_row = array(); } - $group_name = utf8_normalize_nfc(request_var('group_name', '', true)); + $group_name = utf8_normalize_nfc($request->variable('group_name', '', true)); $new_group_name = ($action == 'add') ? $group_name : (($ext_row['group_name'] != $group_name) ? $group_name : ''); if (!$group_name) @@ -538,12 +538,12 @@ class acp_attachments if (!sizeof($error)) { // Ok, build the update/insert array - $upload_icon = request_var('upload_icon', 'no_image'); - $size_select = request_var('size_select', 'b'); - $forum_select = request_var('forum_select', false); - $allowed_forums = request_var('allowed_forums', array(0)); + $upload_icon = $request->variable('upload_icon', 'no_image'); + $size_select = $request->variable('size_select', 'b'); + $forum_select = $request->variable('forum_select', false); + $allowed_forums = $request->variable('allowed_forums', array(0)); $allow_in_pm = (isset($_POST['allow_in_pm'])) ? true : false; - $max_filesize = request_var('max_filesize', 0); + $max_filesize = $request->variable('max_filesize', 0); $max_filesize = ($size_select == 'kb') ? round($max_filesize * 1024) : (($size_select == 'mb') ? round($max_filesize * 1048576) : $max_filesize); $allow_group = (isset($_POST['allow_group'])) ? true : false; @@ -559,7 +559,7 @@ class acp_attachments $group_ary = array( 'group_name' => $group_name, - 'cat_id' => request_var('special_category', ATTACHMENT_CATEGORY_NONE), + 'cat_id' => $request->variable('special_category', ATTACHMENT_CATEGORY_NONE), 'allow_group' => ($allow_group) ? 1 : 0, 'upload_icon' => ($upload_icon == 'no_image') ? '' : $upload_icon, 'max_filesize' => $max_filesize, @@ -587,7 +587,7 @@ class acp_attachments $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ATTACH_EXTGROUP_' . strtoupper($action), false, array($group_name)); } - $extension_list = request_var('extensions', array(0)); + $extension_list = $request->variable('extensions', array(0)); if ($action == 'edit' && sizeof($extension_list)) { @@ -622,7 +622,7 @@ class acp_attachments ATTACHMENT_CATEGORY_QUICKTIME => $user->lang['CAT_QUICKTIME_FILES'], ); - $group_id = request_var('g', 0); + $group_id = $request->variable('g', 0); $action = (isset($_POST['add'])) ? 'add' : $action; switch ($action) @@ -690,7 +690,7 @@ class acp_attachments if ($action == 'add') { $ext_group_row = array( - 'group_name' => utf8_normalize_nfc(request_var('group_name', '', true)), + 'group_name' => utf8_normalize_nfc($request->variable('group_name', '', true)), 'cat_id' => 0, 'allow_group' => 1, 'allow_in_pm' => 1, @@ -906,9 +906,9 @@ class acp_attachments if ($submit) { - $delete_files = (isset($_POST['delete'])) ? array_keys(request_var('delete', array('' => 0))) : array(); - $add_files = (isset($_POST['add'])) ? array_keys(request_var('add', array('' => 0))) : array(); - $post_ids = request_var('post_id', array('' => 0)); + $delete_files = (isset($_POST['delete'])) ? array_keys($request->variable('delete', array('' => 0))) : array(); + $add_files = (isset($_POST['add'])) ? array_keys($request->variable('add', array('' => 0))) : array(); + $post_ids = $request->variable('post_id', array('' => 0)); if (sizeof($delete_files)) { @@ -1074,7 +1074,7 @@ class acp_attachments if ($submit) { - $delete_files = (isset($_POST['delete'])) ? array_keys(request_var('delete', array('' => 0))) : array(); + $delete_files = (isset($_POST['delete'])) ? array_keys($request->variable('delete', array('' => 0))) : array(); if (sizeof($delete_files)) { @@ -1123,12 +1123,12 @@ class acp_attachments 'S_MANAGE' => true, )); - $start = request_var('start', 0); + $start = $request->variable('start', 0); // Sort keys - $sort_days = request_var('st', 0); - $sort_key = request_var('sk', 't'); - $sort_dir = request_var('sd', 'd'); + $sort_days = $request->variable('st', 0); + $sort_key = $request->variable('sk', 't'); + $sort_dir = $request->variable('sd', 'd'); // Sorting $limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']); @@ -1534,7 +1534,7 @@ class acp_attachments if (isset($_REQUEST['securesubmit'])) { // Grab the list of entries - $ips = request_var('ips', ''); + $ips = $request->variable('ips', ''); $ip_list = array_unique(explode("\n", $ips)); $ip_list_log = implode(', ', $ip_list); @@ -1687,7 +1687,7 @@ class acp_attachments } else if (isset($_POST['unsecuresubmit'])) { - $unip_sql = request_var('unip', array(0)); + $unip_sql = $request->variable('unip', array(0)); if (sizeof($unip_sql)) { diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 0e82d233c7..68db486cdf 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -31,8 +31,8 @@ class acp_bbcodes $user->add_lang('acp/posting'); // Set up general vars - $action = request_var('action', ''); - $bbcode_id = request_var('bbcode', 0); + $action = $request->variable('action', ''); + $bbcode_id = $request->variable('bbcode', 0); $this->tpl_name = 'acp_bbcodes'; $this->page_title = 'ACP_BBCODES'; @@ -83,11 +83,11 @@ class acp_bbcodes // No break here case 'create': - $display_on_posting = request_var('display_on_posting', 0); + $display_on_posting = $request->variable('display_on_posting', 0); - $bbcode_match = request_var('bbcode_match', ''); - $bbcode_tpl = htmlspecialchars_decode(utf8_normalize_nfc(request_var('bbcode_tpl', '', true))); - $bbcode_helpline = utf8_normalize_nfc(request_var('bbcode_helpline', '', true)); + $bbcode_match = $request->variable('bbcode_match', ''); + $bbcode_tpl = htmlspecialchars_decode(utf8_normalize_nfc($request->variable('bbcode_tpl', '', true))); + $bbcode_helpline = utf8_normalize_nfc($request->variable('bbcode_helpline', '', true)); break; } diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 1950b7e1cb..3c9f0ef8b3 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -30,13 +30,13 @@ class acp_board function main($id, $mode) { - global $db, $user, $auth, $template; + global $db, $user, $auth, $template, $request; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; global $cache, $phpbb_container, $phpbb_dispatcher, $phpbb_log; $user->add_lang('acp/board'); - $action = request_var('action', ''); + $action = $request->variable('action', ''); $submit = (isset($_POST['submit']) || isset($_POST['allow_quick_reply_enable'])) ? true : false; $form_key = 'acp_board'; @@ -484,7 +484,7 @@ class acp_board } $this->new_config = $config; - $cfg_array = (isset($_REQUEST['config'])) ? utf8_normalize_nfc(request_var('config', array('' => ''), true)) : $this->new_config; + $cfg_array = (isset($_REQUEST['config'])) ? utf8_normalize_nfc($request->variable('config', array('' => ''), true)) : $this->new_config; $error = array(); // We validate the complete config if wished @@ -1049,10 +1049,10 @@ class acp_board function store_feed_forums($option, $key) { - global $db, $cache; + global $db, $cache, $request; // Get key - $values = request_var($key, array(0 => 0)); + $values = $request->variable($key, array(0 => 0)); // Empty option bit for all forums $sql = 'UPDATE ' . FORUMS_TABLE . ' diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php index d630b2ed2d..3ce701f2a9 100644 --- a/phpBB/includes/acp/acp_bots.php +++ b/phpBB/includes/acp/acp_bots.php @@ -28,10 +28,10 @@ class acp_bots global $config, $db, $user, $auth, $template, $cache, $request, $phpbb_log; global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; - $action = request_var('action', ''); + $action = $request->variable('action', ''); $submit = (isset($_POST['submit'])) ? true : false; - $mark = request_var('mark', array(0)); - $bot_id = request_var('id', 0); + $mark = $request->variable('mark', array(0)); + $bot_id = $request->variable('id', 0); if (isset($_POST['add'])) { @@ -144,12 +144,12 @@ class acp_bots include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); $bot_row = array( - 'bot_name' => utf8_normalize_nfc(request_var('bot_name', '', true)), - 'bot_agent' => request_var('bot_agent', ''), - 'bot_ip' => request_var('bot_ip', ''), - 'bot_active' => request_var('bot_active', true), - 'bot_lang' => request_var('bot_lang', $config['default_lang']), - 'bot_style' => request_var('bot_style' , $config['default_style']), + 'bot_name' => utf8_normalize_nfc($request->variable('bot_name', '', true)), + 'bot_agent' => $request->variable('bot_agent', ''), + 'bot_ip' => $request->variable('bot_ip', ''), + 'bot_active' => $request->variable('bot_active', true), + 'bot_lang' => $request->variable('bot_lang', $config['default_lang']), + 'bot_style' => $request->variable('bot_style' , $config['default_style']), ); if ($submit) diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php index ec55d8f6b6..1f6fbc2cae 100644 --- a/phpBB/includes/acp/acp_captcha.php +++ b/phpBB/includes/acp/acp_captcha.php @@ -25,7 +25,7 @@ class acp_captcha function main($id, $mode) { - global $db, $user, $auth, $template, $phpbb_log; + global $db, $user, $auth, $template, $phpbb_log, $request; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container; $user->add_lang('acp/board'); @@ -34,9 +34,9 @@ class acp_captcha $factory = $phpbb_container->get('captcha.factory'); $captchas = $factory->get_captcha_types(); - $selected = request_var('select_captcha', $config['captcha_plugin']); + $selected = $request->variable('select_captcha', $config['captcha_plugin']); $selected = (isset($captchas['available'][$selected]) || isset($captchas['unavailable'][$selected])) ? $selected : $config['captcha_plugin']; - $configure = request_var('configure', false); + $configure = $request->variable('configure', false); // Oh, they are just here for the view if (isset($_GET['captcha_demo'])) @@ -65,13 +65,13 @@ class acp_captcha $form_key = 'acp_captcha'; add_form_key($form_key); - $submit = request_var('main_submit', false); + $submit = $request->variable('main_submit', false); if ($submit && check_form_key($form_key)) { foreach ($config_vars as $config_var => $options) { - $config->set($config_var, request_var($config_var, $options['default'])); + $config->set($config_var, $request->variable($config_var, $options['default'])); } if ($selected !== $config['captcha_plugin']) @@ -118,7 +118,7 @@ class acp_captcha foreach ($config_vars as $config_var => $options) { - $template->assign_var($options['tpl'], (isset($_POST[$config_var])) ? request_var($config_var, $options['default']) : $config[$config_var]) ; + $template->assign_var($options['tpl'], (isset($_POST[$config_var])) ? $request->variable($config_var, $options['default']) : $config[$config_var]) ; } $template->assign_vars(array( diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 6454b30ec3..fb02e58b13 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -26,7 +26,7 @@ class acp_database function main($id, $mode) { - global $cache, $db, $user, $auth, $template, $table_prefix; + global $cache, $db, $user, $auth, $template, $table_prefix, $request; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_log; $this->db_tools = new \phpbb\db\tools\tools($db); @@ -36,7 +36,7 @@ class acp_database $this->tpl_name = 'acp_database'; $this->page_title = 'ACP_DATABASE'; - $action = request_var('action', ''); + $action = $request->variable('action', ''); $submit = (isset($_POST['submit'])) ? true : false; $template->assign_vars(array( @@ -52,10 +52,10 @@ class acp_database switch ($action) { case 'download': - $type = request_var('type', ''); - $table = array_intersect($this->db_tools->sql_list_tables(), request_var('table', array(''))); - $format = request_var('method', ''); - $where = request_var('where', ''); + $type = $request->variable('type', ''); + $table = array_intersect($this->db_tools->sql_list_tables(), $request->variable('table', array(''))); + $format = $request->variable('method', ''); + $where = $request->variable('where', ''); if (!sizeof($table)) { @@ -221,9 +221,9 @@ class acp_database switch ($action) { case 'submit': - $delete = request_var('delete', ''); - $file = request_var('file', ''); - $download = request_var('download', ''); + $delete = $request->variable('delete', ''); + $file = $request->variable('file', ''); + $download = $request->variable('download', ''); if (!preg_match('#^backup_\d{10,}_[a-z\d]{16}\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches)) { @@ -1868,7 +1868,8 @@ class oracle_extractor extends base_extractor { function write_table($table_name) { - global $db; + global $db, $request; + $sql_data = '-- Table: ' . $table_name . "\n"; $sql_data .= "DROP TABLE $table_name\n/\n"; $sql_data .= "\nCREATE TABLE $table_name (\n"; @@ -1961,7 +1962,7 @@ class oracle_extractor extends base_extractor AND C.SEQUENCE_NAME = A.REFERENCED_NAME"; $result = $db->sql_query($sql); - $type = request_var('type', ''); + $type = $request->variable('type', ''); while ($row = $db->sql_fetchrow($result)) { diff --git a/phpBB/includes/acp/acp_disallow.php b/phpBB/includes/acp/acp_disallow.php index adcaa13e4d..aecb8be11a 100644 --- a/phpBB/includes/acp/acp_disallow.php +++ b/phpBB/includes/acp/acp_disallow.php @@ -25,7 +25,7 @@ class acp_disallow function main($id, $mode) { - global $db, $user, $auth, $template, $cache, $phpbb_log; + global $db, $user, $auth, $template, $cache, $phpbb_log, $request; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; include($phpbb_root_path . 'includes/functions_user.' . $phpEx); @@ -49,7 +49,7 @@ class acp_disallow if ($disallow) { - $disallowed_user = str_replace('*', '%', utf8_normalize_nfc(request_var('disallowed_user', '', true))); + $disallowed_user = str_replace('*', '%', utf8_normalize_nfc($request->variable('disallowed_user', '', true))); if (!$disallowed_user) { @@ -80,7 +80,7 @@ class acp_disallow } else if ($allow) { - $disallowed_id = request_var('disallowed_id', 0); + $disallowed_id = $request->variable('disallowed_id', 0); if (!$disallowed_id) { diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php index d67999ab45..3416aecc71 100644 --- a/phpBB/includes/acp/acp_email.php +++ b/phpBB/includes/acp/acp_email.php @@ -25,7 +25,7 @@ class acp_email function main($id, $mode) { - global $config, $db, $user, $auth, $template, $cache, $phpbb_log; + global $config, $db, $user, $auth, $template, $cache, $phpbb_log, $request; global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $phpbb_dispatcher; $user->add_lang('acp/email'); @@ -39,11 +39,11 @@ class acp_email $submit = (isset($_POST['submit'])) ? true : false; $error = array(); - $usernames = request_var('usernames', '', true); + $usernames = $request->variable('usernames', '', true); $usernames = (!empty($usernames)) ? explode("\n", $usernames) : array(); - $group_id = request_var('g', 0); - $subject = utf8_normalize_nfc(request_var('subject', '', true)); - $message = utf8_normalize_nfc(request_var('message', '', true)); + $group_id = $request->variable('g', 0); + $subject = utf8_normalize_nfc($request->variable('subject', '', true)); + $message = utf8_normalize_nfc($request->variable('message', '', true)); // Do the job ... if ($submit) @@ -51,7 +51,7 @@ class acp_email // Error checking needs to go here ... if no subject and/or no message then skip // over the send and return to the form $use_queue = (isset($_POST['send_immediately'])) ? false : true; - $priority = request_var('mail_priority_flag', MAIL_NORMAL_PRIORITY); + $priority = $request->variable('mail_priority_flag', MAIL_NORMAL_PRIORITY); if (!check_form_key($form_key)) { diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index df37c48ec3..8380f4c613 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -36,11 +36,11 @@ class acp_forums $form_key = 'acp_forums'; add_form_key($form_key); - $action = request_var('action', ''); + $action = $request->variable('action', ''); $update = (isset($_POST['update'])) ? true : false; - $forum_id = request_var('f', 0); + $forum_id = $request->variable('f', 0); - $this->parent_id = request_var('parent_id', 0); + $this->parent_id = $request->variable('parent_id', 0); $forum_data = $errors = array(); if ($update && !check_form_key($form_key)) { @@ -52,8 +52,8 @@ class acp_forums switch ($action) { case 'progress_bar': - $start = request_var('start', 0); - $total = request_var('total', 0); + $start = $request->variable('start', 0); + $total = $request->variable('total', 0); $this->display_progress_bar($start, $total); break; @@ -83,10 +83,10 @@ class acp_forums switch ($action) { case 'delete': - $action_subforums = request_var('action_subforums', ''); - $subforums_to_id = request_var('subforums_to_id', 0); - $action_posts = request_var('action_posts', ''); - $posts_to_id = request_var('posts_to_id', 0); + $action_subforums = $request->variable('action_subforums', ''); + $subforums_to_id = $request->variable('subforums_to_id', 0); + $action_posts = $request->variable('action_posts', ''); + $posts_to_id = $request->variable('posts_to_id', 0); $errors = $this->delete_forum($forum_id, $action_posts, $action_subforums, $posts_to_id, $subforums_to_id); @@ -112,45 +112,45 @@ class acp_forums case 'add': $forum_data += array( - 'parent_id' => request_var('forum_parent_id', $this->parent_id), - 'forum_type' => request_var('forum_type', FORUM_POST), - 'type_action' => request_var('type_action', ''), - 'forum_status' => request_var('forum_status', ITEM_UNLOCKED), + 'parent_id' => $request->variable('forum_parent_id', $this->parent_id), + 'forum_type' => $request->variable('forum_type', FORUM_POST), + 'type_action' => $request->variable('type_action', ''), + 'forum_status' => $request->variable('forum_status', ITEM_UNLOCKED), 'forum_parents' => '', - 'forum_name' => utf8_normalize_nfc(request_var('forum_name', '', true)), - 'forum_link' => request_var('forum_link', ''), - 'forum_link_track' => request_var('forum_link_track', false), - 'forum_desc' => utf8_normalize_nfc(request_var('forum_desc', '', true)), + 'forum_name' => utf8_normalize_nfc($request->variable('forum_name', '', true)), + 'forum_link' => $request->variable('forum_link', ''), + 'forum_link_track' => $request->variable('forum_link_track', false), + 'forum_desc' => utf8_normalize_nfc($request->variable('forum_desc', '', true)), 'forum_desc_uid' => '', 'forum_desc_options' => 7, 'forum_desc_bitfield' => '', - 'forum_rules' => utf8_normalize_nfc(request_var('forum_rules', '', true)), + 'forum_rules' => utf8_normalize_nfc($request->variable('forum_rules', '', true)), 'forum_rules_uid' => '', 'forum_rules_options' => 7, 'forum_rules_bitfield' => '', - 'forum_rules_link' => request_var('forum_rules_link', ''), - 'forum_image' => request_var('forum_image', ''), - 'forum_style' => request_var('forum_style', 0), - 'display_subforum_list' => request_var('display_subforum_list', false), - 'display_on_index' => request_var('display_on_index', false), - 'forum_topics_per_page' => request_var('topics_per_page', 0), - 'enable_indexing' => request_var('enable_indexing', true), - 'enable_icons' => request_var('enable_icons', false), - 'enable_prune' => request_var('enable_prune', false), - 'enable_post_review' => request_var('enable_post_review', true), - 'enable_quick_reply' => request_var('enable_quick_reply', false), - 'enable_shadow_prune' => request_var('enable_shadow_prune', false), - 'prune_days' => request_var('prune_days', 7), - 'prune_viewed' => request_var('prune_viewed', 7), - 'prune_freq' => request_var('prune_freq', 1), - 'prune_old_polls' => request_var('prune_old_polls', false), - 'prune_announce' => request_var('prune_announce', false), - 'prune_sticky' => request_var('prune_sticky', false), - 'prune_shadow_days' => request_var('prune_shadow_days', 7), - 'prune_shadow_freq' => request_var('prune_shadow_freq', 1), - 'forum_password' => request_var('forum_password', '', true), - 'forum_password_confirm'=> request_var('forum_password_confirm', '', true), - 'forum_password_unset' => request_var('forum_password_unset', false), + 'forum_rules_link' => $request->variable('forum_rules_link', ''), + 'forum_image' => $request->variable('forum_image', ''), + 'forum_style' => $request->variable('forum_style', 0), + 'display_subforum_list' => $request->variable('display_subforum_list', false), + 'display_on_index' => $request->variable('display_on_index', false), + 'forum_topics_per_page' => $request->variable('topics_per_page', 0), + 'enable_indexing' => $request->variable('enable_indexing', true), + 'enable_icons' => $request->variable('enable_icons', false), + 'enable_prune' => $request->variable('enable_prune', false), + 'enable_post_review' => $request->variable('enable_post_review', true), + 'enable_quick_reply' => $request->variable('enable_quick_reply', false), + 'enable_shadow_prune' => $request->variable('enable_shadow_prune', false), + 'prune_days' => $request->variable('prune_days', 7), + 'prune_viewed' => $request->variable('prune_viewed', 7), + 'prune_freq' => $request->variable('prune_freq', 1), + 'prune_old_polls' => $request->variable('prune_old_polls', false), + 'prune_announce' => $request->variable('prune_announce', false), + 'prune_sticky' => $request->variable('prune_sticky', false), + 'prune_shadow_days' => $request->variable('prune_shadow_days', 7), + 'prune_shadow_freq' => $request->variable('prune_shadow_freq', 1), + 'forum_password' => $request->variable('forum_password', '', true), + 'forum_password_confirm'=> $request->variable('forum_password_confirm', '', true), + 'forum_password_unset' => $request->variable('forum_password_unset', false), ); /** @@ -173,7 +173,7 @@ class acp_forums // Use link_display_on_index setting if forum type is link if ($forum_data['forum_type'] == FORUM_LINK) { - $forum_data['display_on_index'] = request_var('link_display_on_index', false); + $forum_data['display_on_index'] = $request->variable('link_display_on_index', false); } // Linked forums and categories are not able to be locked... @@ -182,25 +182,25 @@ class acp_forums $forum_data['forum_status'] = ITEM_UNLOCKED; } - $forum_data['show_active'] = ($forum_data['forum_type'] == FORUM_POST) ? request_var('display_recent', true) : request_var('display_active', false); + $forum_data['show_active'] = ($forum_data['forum_type'] == FORUM_POST) ? $request->variable('display_recent', true) : $request->variable('display_active', false); // Get data for forum rules if specified... if ($forum_data['forum_rules']) { - generate_text_for_storage($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], $forum_data['forum_rules_options'], request_var('rules_parse_bbcode', false), request_var('rules_parse_urls', false), request_var('rules_parse_smilies', false)); + generate_text_for_storage($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], $forum_data['forum_rules_options'], $request->variable('rules_parse_bbcode', false), $request->variable('rules_parse_urls', false), $request->variable('rules_parse_smilies', false)); } // Get data for forum description if specified if ($forum_data['forum_desc']) { - generate_text_for_storage($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options'], request_var('desc_parse_bbcode', false), request_var('desc_parse_urls', false), request_var('desc_parse_smilies', false)); + generate_text_for_storage($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options'], $request->variable('desc_parse_bbcode', false), $request->variable('desc_parse_urls', false), $request->variable('desc_parse_smilies', false)); } $errors = $this->update_forum_data($forum_data); if (!sizeof($errors)) { - $forum_perm_from = request_var('forum_perm_from', 0); + $forum_perm_from = $request->variable('forum_perm_from', 0); $cache->destroy('sql', FORUMS_TABLE); $copied_permissions = false; @@ -311,7 +311,7 @@ class acp_forums $row2['min_topic_id'] = (int) $row2['min_topic_id']; $row2['max_topic_id'] = (int) $row2['max_topic_id']; - $start = request_var('start', $row2['min_topic_id']); + $start = $request->variable('start', $row2['min_topic_id']); $batch_size = 2000; $end = $start + $batch_size; @@ -327,7 +327,7 @@ class acp_forums WHERE forum_id = ' . $forum_id . ' AND topic_id BETWEEN ' . $start . ' AND ' . $end; $result = $db->sql_query($sql); - $topics_done = request_var('topics_done', 0) + (int) $db->sql_fetchfield('num_topics'); + $topics_done = $request->variable('topics_done', 0) + (int) $db->sql_fetchfield('num_topics'); $db->sql_freeresult($result); $start += $batch_size; @@ -391,13 +391,13 @@ class acp_forums if ($update) { $forum_data['forum_flags'] = 0; - $forum_data['forum_flags'] += (request_var('forum_link_track', false)) ? FORUM_FLAG_LINK_TRACK : 0; - $forum_data['forum_flags'] += (request_var('prune_old_polls', false)) ? FORUM_FLAG_PRUNE_POLL : 0; - $forum_data['forum_flags'] += (request_var('prune_announce', false)) ? FORUM_FLAG_PRUNE_ANNOUNCE : 0; - $forum_data['forum_flags'] += (request_var('prune_sticky', false)) ? FORUM_FLAG_PRUNE_STICKY : 0; + $forum_data['forum_flags'] += ($request->variable('forum_link_track', false)) ? FORUM_FLAG_LINK_TRACK : 0; + $forum_data['forum_flags'] += ($request->variable('prune_old_polls', false)) ? FORUM_FLAG_PRUNE_POLL : 0; + $forum_data['forum_flags'] += ($request->variable('prune_announce', false)) ? FORUM_FLAG_PRUNE_ANNOUNCE : 0; + $forum_data['forum_flags'] += ($request->variable('prune_sticky', false)) ? FORUM_FLAG_PRUNE_STICKY : 0; $forum_data['forum_flags'] += ($forum_data['show_active']) ? FORUM_FLAG_ACTIVE_TOPICS : 0; - $forum_data['forum_flags'] += (request_var('enable_post_review', true)) ? FORUM_FLAG_POST_REVIEW : 0; - $forum_data['forum_flags'] += (request_var('enable_quick_reply', false)) ? FORUM_FLAG_QUICK_REPLY : 0; + $forum_data['forum_flags'] += ($request->variable('enable_post_review', true)) ? FORUM_FLAG_POST_REVIEW : 0; + $forum_data['forum_flags'] += ($request->variable('enable_quick_reply', false)) ? FORUM_FLAG_QUICK_REPLY : 0; } // Initialise $row, so we always have it in the event @@ -445,7 +445,7 @@ class acp_forums 'parent_id' => $this->parent_id, 'forum_type' => FORUM_POST, 'forum_status' => ITEM_UNLOCKED, - 'forum_name' => utf8_normalize_nfc(request_var('forum_name', '', true)), + 'forum_name' => utf8_normalize_nfc($request->variable('forum_name', '', true)), 'forum_link' => '', 'forum_link_track' => false, 'forum_desc' => '', @@ -517,7 +517,7 @@ class acp_forums $forum_data['forum_rules_bitfield'] = ''; $forum_data['forum_rules_options'] = 0; - generate_text_for_storage($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], $forum_data['forum_rules_options'], request_var('rules_allow_bbcode', false), request_var('rules_allow_urls', false), request_var('rules_allow_smilies', false)); + generate_text_for_storage($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], $forum_data['forum_rules_options'], $request->variable('rules_allow_bbcode', false), $request->variable('rules_allow_urls', false), $request->variable('rules_allow_smilies', false)); } // Generate preview content @@ -537,7 +537,7 @@ class acp_forums $forum_data['forum_desc_bitfield'] = ''; $forum_data['forum_desc_options'] = 0; - generate_text_for_storage($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options'], request_var('desc_allow_bbcode', false), request_var('desc_allow_urls', false), request_var('desc_allow_smilies', false)); + generate_text_for_storage($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options'], $request->variable('desc_allow_bbcode', false), $request->variable('desc_allow_urls', false), $request->variable('desc_allow_smilies', false)); } // decode... @@ -780,7 +780,7 @@ class acp_forums break; case 'copy_perm': - $forum_perm_from = request_var('forum_perm_from', 0); + $forum_perm_from = $request->variable('forum_perm_from', 0); // Copy permissions? if (!empty($forum_perm_from) && $forum_perm_from != $forum_id) @@ -946,7 +946,7 @@ class acp_forums */ function update_forum_data(&$forum_data) { - global $db, $user, $cache, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher, $phpbb_log; + global $db, $user, $cache, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher, $phpbb_log, $request; $errors = array(); @@ -1146,7 +1146,7 @@ class acp_forums // we're turning a postable forum into a non-postable forum if ($forum_data_sql['type_action'] == 'move') { - $to_forum_id = request_var('to_forum_id', 0); + $to_forum_id = $request->variable('to_forum_id', 0); if ($to_forum_id) { @@ -1176,8 +1176,8 @@ class acp_forums if ($row['right_id'] - $row['left_id'] > 1) { // We are turning a category into a link - but need to decide what to do with the subforums. - $action_subforums = request_var('action_subforums', ''); - $subforums_to_id = request_var('subforums_to_id', 0); + $action_subforums = $request->variable('action_subforums', ''); + $subforums_to_id = $request->variable('subforums_to_id', 0); if ($action_subforums == 'delete') { diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index 1293c92509..2d23477482 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -45,13 +45,13 @@ class acp_groups include($phpbb_root_path . 'includes/functions_user.' . $phpEx); // Check and set some common vars - $action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['addusers'])) ? 'addusers' : request_var('action', '')); - $group_id = request_var('g', 0); - $mark_ary = request_var('mark', array(0)); - $name_ary = request_var('usernames', '', true); - $leader = request_var('leader', 0); - $default = request_var('default', 0); - $start = request_var('start', 0); + $action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['addusers'])) ? 'addusers' : $request->variable('action', '')); + $group_id = $request->variable('g', 0); + $mark_ary = $request->variable('mark', array(0)); + $name_ary = $request->variable('usernames', '', true); + $leader = $request->variable('leader', 0); + $default = $request->variable('default', 0); + $start = $request->variable('start', 0); $update = (isset($_POST['update'])) ? true : false; // Clear some vars @@ -362,24 +362,24 @@ class acp_groups trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); } - $group_name = utf8_normalize_nfc(request_var('group_name', '', true)); - $group_desc = utf8_normalize_nfc(request_var('group_desc', '', true)); - $group_type = request_var('group_type', GROUP_FREE); + $group_name = utf8_normalize_nfc($request->variable('group_name', '', true)); + $group_desc = utf8_normalize_nfc($request->variable('group_desc', '', true)); + $group_type = $request->variable('group_type', GROUP_FREE); - $allow_desc_bbcode = request_var('desc_parse_bbcode', false); - $allow_desc_urls = request_var('desc_parse_urls', false); - $allow_desc_smilies = request_var('desc_parse_smilies', false); + $allow_desc_bbcode = $request->variable('desc_parse_bbcode', false); + $allow_desc_urls = $request->variable('desc_parse_urls', false); + $allow_desc_smilies = $request->variable('desc_parse_smilies', false); $submit_ary = array( - 'colour' => request_var('group_colour', ''), - 'rank' => request_var('group_rank', 0), + 'colour' => $request->variable('group_colour', ''), + 'rank' => $request->variable('group_rank', 0), 'receive_pm' => isset($_REQUEST['group_receive_pm']) ? 1 : 0, 'legend' => isset($_REQUEST['group_legend']) ? 1 : 0, 'teampage' => isset($_REQUEST['group_teampage']) ? 1 : 0, - 'message_limit' => request_var('group_message_limit', 0), - 'max_recipients' => request_var('group_max_recipients', 0), + 'message_limit' => $request->variable('group_message_limit', 0), + 'max_recipients' => $request->variable('group_max_recipients', 0), 'founder_manage' => 0, - 'skip_auth' => request_var('group_skip_auth', 0), + 'skip_auth' => $request->variable('group_skip_auth', 0), ); if ($user->data['user_type'] == USER_FOUNDER) @@ -548,7 +548,7 @@ class acp_groups if (!($error = group_create($group_id, $group_type, $group_name, $group_desc, $group_attributes, $allow_desc_bbcode, $allow_desc_urls, $allow_desc_smilies))) { - $group_perm_from = request_var('group_perm_from', 0); + $group_perm_from = $request->variable('group_perm_from', 0); // Copy permissions? // If the user has the a_authgroups permission and at least one additional permission ability set the permissions are fully transferred. @@ -618,7 +618,7 @@ class acp_groups } else if (!$group_id) { - $group_name = utf8_normalize_nfc(request_var('group_name', '', true)); + $group_name = utf8_normalize_nfc($request->variable('group_name', '', true)); $group_desc_data = array( 'text' => '', 'allow_bbcode' => true, @@ -696,12 +696,12 @@ class acp_groups $error = array_merge($error, $phpbb_avatar_manager->localize_errors($user, $avatar_error)); } - $back_link = request_var('back_link', ''); + $back_link = $request->variable('back_link', ''); switch ($back_link) { case 'acp_users_groups': - $u_back = append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&mode=groups&u=' . request_var('u', 0)); + $u_back = append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&mode=groups&u=' . $request->variable('u', 0)); break; default: diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index ebdacfe0b8..6105bdcc92 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -35,11 +35,11 @@ class acp_icons $user->add_lang('acp/posting'); // Set up general vars - $action = request_var('action', ''); + $action = $request->variable('action', ''); $action = (isset($_POST['add'])) ? 'add' : $action; $action = (isset($_POST['edit'])) ? 'edit' : $action; $action = (isset($_POST['import'])) ? 'import' : $action; - $icon_id = request_var('id', 0); + $icon_id = $request->variable('id', 0); $mode = ($mode == 'smilies') ? 'smilies' : 'icons'; @@ -326,24 +326,24 @@ class acp_icons case 'modify': // Get items to create/modify - $images = (isset($_POST['image'])) ? array_keys(request_var('image', array('' => 0))) : array(); + $images = (isset($_POST['image'])) ? array_keys($request->variable('image', array('' => 0))) : array(); // Now really get the items - $image_id = (isset($_POST['id'])) ? request_var('id', array('' => 0)) : array(); - $image_order = (isset($_POST['order'])) ? request_var('order', array('' => 0)) : array(); - $image_width = (isset($_POST['width'])) ? request_var('width', array('' => 0)) : array(); - $image_height = (isset($_POST['height'])) ? request_var('height', array('' => 0)) : array(); - $image_add = (isset($_POST['add_img'])) ? request_var('add_img', array('' => 0)) : array(); - $image_emotion = utf8_normalize_nfc(request_var('emotion', array('' => ''), true)); - $image_code = utf8_normalize_nfc(request_var('code', array('' => ''), true)); - $image_display_on_posting = (isset($_POST['display_on_posting'])) ? request_var('display_on_posting', array('' => 0)) : array(); + $image_id = (isset($_POST['id'])) ? $request->variable('id', array('' => 0)) : array(); + $image_order = (isset($_POST['order'])) ? $request->variable('order', array('' => 0)) : array(); + $image_width = (isset($_POST['width'])) ? $request->variable('width', array('' => 0)) : array(); + $image_height = (isset($_POST['height'])) ? $request->variable('height', array('' => 0)) : array(); + $image_add = (isset($_POST['add_img'])) ? $request->variable('add_img', array('' => 0)) : array(); + $image_emotion = utf8_normalize_nfc($request->variable('emotion', array('' => ''), true)); + $image_code = utf8_normalize_nfc($request->variable('code', array('' => ''), true)); + $image_display_on_posting = (isset($_POST['display_on_posting'])) ? $request->variable('display_on_posting', array('' => 0)) : array(); // Ok, add the relevant bits if we are adding new codes to existing emoticons... if ($request->variable('add_additional_code', false, false, \phpbb\request\request_interface::POST)) { - $add_image = request_var('add_image', ''); - $add_code = utf8_normalize_nfc(request_var('add_code', '', true)); - $add_emotion = utf8_normalize_nfc(request_var('add_emotion', '', true)); + $add_image = $request->variable('add_image', ''); + $add_code = utf8_normalize_nfc($request->variable('add_code', '', true)); + $add_emotion = utf8_normalize_nfc($request->variable('add_emotion', '', true)); if ($add_image && $add_emotion && $add_code) { @@ -352,15 +352,15 @@ class acp_icons $image_code[$add_image] = $add_code; $image_emotion[$add_image] = $add_emotion; - $image_width[$add_image] = request_var('add_width', 0); - $image_height[$add_image] = request_var('add_height', 0); + $image_width[$add_image] = $request->variable('add_width', 0); + $image_height[$add_image] = $request->variable('add_height', 0); if ($request->variable('add_display_on_posting', false, false, \phpbb\request\request_interface::POST)) { $image_display_on_posting[$add_image] = 1; } - $image_order[$add_image] = request_var('add_order', 0); + $image_order[$add_image] = $request->variable('add_order', 0); } } @@ -506,8 +506,8 @@ class acp_icons case 'import': - $pak = request_var('pak', ''); - $current = request_var('current', ''); + $pak = $request->variable('pak', ''); + $current = $request->variable('current', ''); if ($pak != '') { @@ -905,7 +905,7 @@ class acp_icons /* @var $pagination \phpbb\pagination */ $pagination = $phpbb_container->get('pagination'); - $pagination_start = request_var('start', 0); + $pagination_start = $request->variable('start', 0); $spacer = false; $item_count = $this->item_count($table); diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php index 4b747b62d9..3a72cf1fe6 100644 --- a/phpBB/includes/acp/acp_inactive.php +++ b/phpBB/includes/acp/acp_inactive.php @@ -31,22 +31,22 @@ class acp_inactive function main($id, $mode) { - global $config, $db, $user, $auth, $template, $phpbb_container, $phpbb_log; + global $config, $db, $user, $auth, $template, $phpbb_container, $phpbb_log, $request; global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; include($phpbb_root_path . 'includes/functions_user.' . $phpEx); $user->add_lang('memberlist'); - $action = request_var('action', ''); - $mark = (isset($_REQUEST['mark'])) ? request_var('mark', array(0)) : array(); - $start = request_var('start', 0); + $action = $request->variable('action', ''); + $mark = (isset($_REQUEST['mark'])) ? $request->variable('mark', array(0)) : array(); + $start = $request->variable('start', 0); $submit = isset($_POST['submit']); // Sort keys - $sort_days = request_var('st', 0); - $sort_key = request_var('sk', 'i'); - $sort_dir = request_var('sd', 'd'); + $sort_days = $request->variable('st', 0); + $sort_key = $request->variable('sk', 'i'); + $sort_dir = $request->variable('sd', 'd'); $form_key = 'acp_inactive'; add_form_key($form_key); @@ -57,7 +57,7 @@ class acp_inactive // We build the sort key and per page settings here, because they may be needed later // Number of entries to display - $per_page = request_var('users_per_page', (int) $config['topics_per_page']); + $per_page = $request->variable('users_per_page', (int) $config['topics_per_page']); // Sorting $limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']); diff --git a/phpBB/includes/acp/acp_jabber.php b/phpBB/includes/acp/acp_jabber.php index d501e61cbf..d860ae27f4 100644 --- a/phpBB/includes/acp/acp_jabber.php +++ b/phpBB/includes/acp/acp_jabber.php @@ -29,14 +29,14 @@ class acp_jabber function main($id, $mode) { - global $db, $user, $auth, $template, $phpbb_log; + global $db, $user, $auth, $template, $phpbb_log, $request; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $user->add_lang('acp/board'); include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx); - $action = request_var('action', ''); + $action = $request->variable('action', ''); $submit = (isset($_POST['submit'])) ? true : false; if ($mode != 'settings') @@ -47,13 +47,13 @@ class acp_jabber $this->tpl_name = 'acp_jabber'; $this->page_title = 'ACP_JABBER_SETTINGS'; - $jab_enable = request_var('jab_enable', (bool) $config['jab_enable']); - $jab_host = request_var('jab_host', (string) $config['jab_host']); - $jab_port = request_var('jab_port', (int) $config['jab_port']); - $jab_username = request_var('jab_username', (string) $config['jab_username']); - $jab_password = request_var('jab_password', (string) $config['jab_password']); - $jab_package_size = request_var('jab_package_size', (int) $config['jab_package_size']); - $jab_use_ssl = request_var('jab_use_ssl', (bool) $config['jab_use_ssl']); + $jab_enable = $request->variable('jab_enable', (bool) $config['jab_enable']); + $jab_host = $request->variable('jab_host', (string) $config['jab_host']); + $jab_port = $request->variable('jab_port', (int) $config['jab_port']); + $jab_username = $request->variable('jab_username', (string) $config['jab_username']); + $jab_password = $request->variable('jab_password', (string) $config['jab_password']); + $jab_package_size = $request->variable('jab_package_size', (int) $config['jab_package_size']); + $jab_use_ssl = $request->variable('jab_use_ssl', (bool) $config['jab_use_ssl']); $form_name = 'acp_jabber'; add_form_key($form_name); diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php index fe39dcba47..d6b181c6ad 100644 --- a/phpBB/includes/acp/acp_language.php +++ b/phpBB/includes/acp/acp_language.php @@ -41,14 +41,14 @@ class acp_language $action = (isset($_POST['remove_store'])) ? 'details' : $action; $submit = (empty($action) && !isset($_POST['update']) && !isset($_POST['test_connection'])) ? false : true; - $action = (empty($action)) ? request_var('action', '') : $action; + $action = (empty($action)) ? $request->variable('action', '') : $action; $form_name = 'acp_lang'; add_form_key('acp_lang'); - $lang_id = request_var('id', 0); + $lang_id = $request->variable('id', 0); - $selected_lang_file = request_var('language_file', '|common.' . $phpEx); + $selected_lang_file = $request->variable('language_file', '|common.' . $phpEx); list($this->language_directory, $this->language_file) = explode('|', $selected_lang_file); @@ -81,9 +81,9 @@ class acp_language $db->sql_freeresult($result); $sql_ary = array( - 'lang_english_name' => request_var('lang_english_name', $row['lang_english_name']), - 'lang_local_name' => utf8_normalize_nfc(request_var('lang_local_name', $row['lang_local_name'], true)), - 'lang_author' => utf8_normalize_nfc(request_var('lang_author', $row['lang_author'], true)), + 'lang_english_name' => $request->variable('lang_english_name', $row['lang_english_name']), + 'lang_local_name' => utf8_normalize_nfc($request->variable('lang_local_name', $row['lang_local_name'], true)), + 'lang_author' => utf8_normalize_nfc($request->variable('lang_author', $row['lang_author'], true)), ); $db->sql_query('UPDATE ' . LANG_TABLE . ' @@ -241,7 +241,7 @@ class acp_language break; case 'install': - $lang_iso = request_var('iso', ''); + $lang_iso = $request->variable('iso', ''); $lang_iso = basename($lang_iso); if (!$lang_iso || !file_exists("{$phpbb_root_path}language/$lang_iso/iso.txt")) diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php index 642b05b08b..d9923637f7 100644 --- a/phpBB/includes/acp/acp_logs.php +++ b/phpBB/includes/acp/acp_logs.php @@ -32,18 +32,18 @@ class acp_logs $user->add_lang('mcp'); // Set up general vars - $action = request_var('action', ''); - $forum_id = request_var('f', 0); - $topic_id = request_var('t', 0); - $start = request_var('start', 0); + $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); - $marked = request_var('mark', array(0)); + $marked = $request->variable('mark', array(0)); // Sort keys - $sort_days = request_var('st', 0); - $sort_key = request_var('sk', 't'); - $sort_dir = request_var('sd', 'd'); + $sort_days = $request->variable('st', 0); + $sort_key = $request->variable('sk', 't'); + $sort_dir = $request->variable('sd', 'd'); $this->tpl_name = 'acp_logs'; $this->log_type = constant('LOG_' . strtoupper($mode)); @@ -70,7 +70,7 @@ class acp_logs $conditions['log_time'] = array('>=', time() - ($sort_days * 86400)); } - $keywords = utf8_normalize_nfc(request_var('keywords', '', true)); + $keywords = utf8_normalize_nfc($request->variable('keywords', '', true)); $conditions['keywords'] = $keywords; } @@ -108,7 +108,7 @@ class acp_logs $sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0; $sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); - $keywords = utf8_normalize_nfc(request_var('keywords', '', true)); + $keywords = utf8_normalize_nfc($request->variable('keywords', '', true)); $keywords_param = !empty($keywords) ? '&keywords=' . urlencode(htmlspecialchars_decode($keywords)) : ''; $l_title = $user->lang['ACP_' . strtoupper($mode) . '_LOGS']; diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 56a8dc2d83..c49ccdf479 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -53,7 +53,7 @@ class acp_main return; } - $action = request_var('action', ''); + $action = $request->variable('action', ''); if ($action) { diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php index b20c90f69c..6217325e4f 100644 --- a/phpBB/includes/acp/acp_modules.php +++ b/phpBB/includes/acp/acp_modules.php @@ -65,9 +65,9 @@ class acp_modules $this->page_title = strtoupper($this->module_class); - $this->parent_id = request_var('parent_id', 0); - $module_id = request_var('m', 0); - $action = request_var('action', ''); + $this->parent_id = $request->variable('parent_id', 0); + $module_id = $request->variable('m', 0); + $action = $request->variable('action', ''); $errors = array(); switch ($action) @@ -182,7 +182,7 @@ class acp_modules break; case 'quickadd': - $quick_install = request_var('quick_install', ''); + $quick_install = $request->variable('quick_install', ''); if (confirm_box(true)) { @@ -253,7 +253,7 @@ class acp_modules 'module_enabled' => 0, 'module_display' => 1, 'parent_id' => 0, - 'module_langname' => utf8_normalize_nfc(request_var('module_langname', '', true)), + 'module_langname' => utf8_normalize_nfc($request->variable('module_langname', '', true)), 'module_mode' => '', 'module_auth' => '', ); @@ -261,13 +261,13 @@ class acp_modules $module_data = array(); - $module_data['module_basename'] = request_var('module_basename', (string) $module_row['module_basename']); - $module_data['module_enabled'] = request_var('module_enabled', (int) $module_row['module_enabled']); - $module_data['module_display'] = request_var('module_display', (int) $module_row['module_display']); - $module_data['parent_id'] = request_var('module_parent_id', (int) $module_row['parent_id']); + $module_data['module_basename'] = $request->variable('module_basename', (string) $module_row['module_basename']); + $module_data['module_enabled'] = $request->variable('module_enabled', (int) $module_row['module_enabled']); + $module_data['module_display'] = $request->variable('module_display', (int) $module_row['module_display']); + $module_data['parent_id'] = $request->variable('module_parent_id', (int) $module_row['parent_id']); $module_data['module_class'] = $this->module_class; - $module_data['module_langname'] = utf8_normalize_nfc(request_var('module_langname', (string) $module_row['module_langname'], true)); - $module_data['module_mode'] = request_var('module_mode', (string) $module_row['module_mode']); + $module_data['module_langname'] = utf8_normalize_nfc($request->variable('module_langname', (string) $module_row['module_langname'], true)); + $module_data['module_mode'] = $request->variable('module_mode', (string) $module_row['module_mode']); $submit = (isset($_POST['submit'])) ? true : false; @@ -278,7 +278,7 @@ class acp_modules trigger_error($user->lang['NO_MODULE_LANGNAME'] . adm_back_link($this->u_action . '&parent_id=' . $this->parent_id), E_USER_WARNING); } - $module_type = request_var('module_type', 'category'); + $module_type = $request->variable('module_type', 'category'); if ($module_type == 'category') { diff --git a/phpBB/includes/acp/acp_permission_roles.php b/phpBB/includes/acp/acp_permission_roles.php index f7e2065572..d5efbd027c 100644 --- a/phpBB/includes/acp/acp_permission_roles.php +++ b/phpBB/includes/acp/acp_permission_roles.php @@ -41,8 +41,8 @@ class acp_permission_roles $this->tpl_name = 'acp_permission_roles'; $submit = (isset($_POST['submit'])) ? true : false; - $role_id = request_var('role_id', 0); - $action = request_var('action', ''); + $role_id = $request->variable('role_id', 0); + $action = $request->variable('action', ''); $action = (isset($_POST['add'])) ? 'add' : $action; $form_name = 'acp_permissions'; @@ -148,9 +148,9 @@ class acp_permission_roles trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING); } - $role_name = utf8_normalize_nfc(request_var('role_name', '', true)); - $role_description = utf8_normalize_nfc(request_var('role_description', '', true)); - $auth_settings = request_var('setting', array('' => 0)); + $role_name = utf8_normalize_nfc($request->variable('role_name', '', true)); + $role_description = utf8_normalize_nfc($request->variable('role_description', '', true)); + $auth_settings = $request->variable('setting', array('' => 0)); if (!$role_name) { @@ -225,11 +225,11 @@ class acp_permission_roles { case 'add': - $options_from = request_var('options_from', 0); + $options_from = $request->variable('options_from', 0); $role_row = array( - 'role_name' => utf8_normalize_nfc(request_var('role_name', '', true)), - 'role_description' => utf8_normalize_nfc(request_var('role_description', '', true)), + 'role_name' => utf8_normalize_nfc($request->variable('role_name', '', true)), + 'role_description' => utf8_normalize_nfc($request->variable('role_description', '', true)), 'role_type' => $permission_type, ); @@ -414,7 +414,7 @@ class acp_permission_roles $db->sql_freeresult($result); // Display assigned items? - $display_item = request_var('display_item', 0); + $display_item = $request->variable('display_item', 0); // Select existing roles $sql = 'SELECT * diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 802d4999e9..b36eae0f93 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -31,7 +31,7 @@ class acp_permissions function main($id, $mode) { - global $db, $user, $auth, $template, $cache, $phpbb_container; + global $db, $user, $auth, $template, $cache, $phpbb_container, $request; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); @@ -49,9 +49,9 @@ class acp_permissions // Trace has other vars if ($mode == 'trace') { - $user_id = request_var('u', 0); - $forum_id = request_var('f', 0); - $permission = request_var('auth', ''); + $user_id = $request->variable('u', 0); + $forum_id = $request->variable('f', 0); + $permission = $request->variable('auth', ''); $this->tpl_name = 'permission_trace'; @@ -80,20 +80,20 @@ class acp_permissions } // Set some vars - $action = request_var('action', array('' => 0)); + $action = $request->variable('action', array('' => 0)); $action = key($action); $action = (isset($_POST['psubmit'])) ? 'apply_permissions' : $action; - $all_forums = request_var('all_forums', 0); - $subforum_id = request_var('subforum_id', 0); - $forum_id = request_var('forum_id', array(0)); + $all_forums = $request->variable('all_forums', 0); + $subforum_id = $request->variable('subforum_id', 0); + $forum_id = $request->variable('forum_id', array(0)); - $username = request_var('username', array(''), true); - $usernames = request_var('usernames', '', true); - $user_id = request_var('user_id', array(0)); + $username = $request->variable('username', array(''), true); + $usernames = $request->variable('usernames', '', true); + $user_id = $request->variable('user_id', array(0)); - $group_id = request_var('group_id', array(0)); - $select_all_groups = request_var('select_all_groups', 0); + $group_id = $request->variable('group_id', array(0)); + $select_all_groups = $request->variable('select_all_groups', 0); $form_name = 'acp_permissions'; add_form_key($form_name); @@ -232,7 +232,7 @@ class acp_permissions ); // Get permission type - $permission_type = request_var('type', $this->permission_dropdown[0]); + $permission_type = $request->variable('type', $this->permission_dropdown[0]); if (!in_array($permission_type, $this->permission_dropdown)) { @@ -674,7 +674,7 @@ class acp_permissions global $db, $cache, $user, $auth; global $request; - $psubmit = request_var('psubmit', array(0 => array(0 => 0))); + $psubmit = $request->variable('psubmit', array(0 => array(0 => 0))); // User or group to be set? $ug_type = (sizeof($user_id)) ? 'user' : 'group'; @@ -704,7 +704,7 @@ class acp_permissions $assigned_role = (isset($roles[$ug_id][$forum_id])) ? (int) $roles[$ug_id][$forum_id] : 0; // Do the admin want to set these permissions to other items too? - $inherit = request_var('inherit', array(0 => array(0))); + $inherit = $request->variable('inherit', array(0 => array(0))); $ug_id = array($ug_id); $forum_id = array($forum_id); @@ -963,7 +963,7 @@ class acp_permissions */ function permission_trace($user_id, $forum_id, $permission) { - global $db, $template, $user, $auth; + global $db, $template, $user, $auth, $request; if ($user_id != $user->data['user_id']) { @@ -991,7 +991,7 @@ class acp_permissions $db->sql_freeresult($result); } - $back = request_var('back', 0); + $back = $request->variable('back', 0); $template->assign_vars(array( 'PERMISSION' => $this->permissions->get_permission_lang($permission), @@ -1182,7 +1182,7 @@ class acp_permissions */ function copy_forum_permissions() { - global $db, $auth, $cache, $template, $user; + global $db, $auth, $cache, $template, $user, $request; $user->add_lang('acp/forums'); @@ -1190,8 +1190,8 @@ class acp_permissions if ($submit) { - $src = request_var('src_forum_id', 0); - $dest = request_var('dest_forum_ids', array(0)); + $src = $request->variable('src_forum_id', 0); + $dest = $request->variable('dest_forum_ids', array(0)); if (confirm_box(true)) { diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index 9a24978f58..03d66283d9 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -45,7 +45,7 @@ class acp_profile $this->page_title = 'ACP_CUSTOM_PROFILE_FIELDS'; $field_id = $request->variable('field_id', 0); - $action = (isset($_POST['create'])) ? 'create' : request_var('action', ''); + $action = (isset($_POST['create'])) ? 'create' : $request->variable('action', ''); $error = array(); $s_hidden_fields = ''; @@ -261,7 +261,7 @@ class acp_profile case 'create': case 'edit': - $step = request_var('step', 1); + $step = $request->variable('step', 1); $submit = (isset($_REQUEST['next']) || isset($_REQUEST['prev'])) ? true : false; $save = (isset($_REQUEST['save'])) ? true : false; @@ -325,7 +325,7 @@ class acp_profile // We are adding a new field, define basic params $lang_options = $field_row = array(); - $field_type = request_var('field_type', ''); + $field_type = $request->variable('field_type', ''); if (!isset($this->type_collection[$field_type])) { @@ -334,7 +334,7 @@ class acp_profile $profile_field = $this->type_collection[$field_type]; $field_row = array_merge($profile_field->get_default_option_values(), array( - 'field_ident' => str_replace(' ', '_', utf8_clean_string(request_var('field_ident', '', true))), + 'field_ident' => str_replace(' ', '_', utf8_clean_string($request->variable('field_ident', '', true))), 'field_required' => 0, 'field_show_novalue'=> 0, 'field_hide' => 0, @@ -347,7 +347,7 @@ class acp_profile 'field_is_contact' => 0, 'field_contact_desc'=> '', 'field_contact_url' => '', - 'lang_name' => utf8_normalize_nfc(request_var('field_ident', '', true)), + 'lang_name' => utf8_normalize_nfc($request->variable('field_ident', '', true)), 'lang_explain' => '', 'lang_default_value'=> '') ); @@ -377,7 +377,7 @@ class acp_profile $options = $profile_field->prepare_options_form($exclude, $visibility_ary); - $cp->vars['field_ident'] = ($action == 'create' && $step == 1) ? utf8_clean_string(request_var('field_ident', $field_row['field_ident'], true)) : request_var('field_ident', $field_row['field_ident']); + $cp->vars['field_ident'] = ($action == 'create' && $step == 1) ? utf8_clean_string($request->variable('field_ident', $field_row['field_ident'], true)) : $request->variable('field_ident', $field_row['field_ident']); $cp->vars['lang_name'] = $request->variable('lang_name', $field_row['lang_name'], true); $cp->vars['lang_explain'] = $request->variable('lang_explain', $field_row['lang_explain'], true); $cp->vars['lang_default_value'] = $request->variable('lang_default_value', $field_row['lang_default_value'], true); @@ -416,7 +416,7 @@ class acp_profile // step 2 foreach ($exclude[2] as $key) { - $var = utf8_normalize_nfc(request_var($key, $field_row[$key], true)); + $var = utf8_normalize_nfc($request->variable($key, $field_row[$key], true)); $field_data = $cp->vars; $var = $profile_field->get_excluded_options($key, $action, $var, $field_data, 2); @@ -462,7 +462,7 @@ class acp_profile foreach ($exclude[3] as $key) { - $cp->vars[$key] = utf8_normalize_nfc(request_var($key, array(0 => ''), true)); + $cp->vars[$key] = utf8_normalize_nfc($request->variable($key, array(0 => ''), true)); if (!$cp->vars[$key] && $action == 'edit') { @@ -719,7 +719,7 @@ class acp_profile */ function build_language_options(&$cp, $field_type, $action = 'create') { - global $user, $config, $db, $phpbb_container; + global $user, $config, $db, $phpbb_container, $request; $default_lang_id = (!empty($this->edit_lang_id)) ? $this->edit_lang_id : $this->lang_defs['iso'][$config['default_lang']]; @@ -760,7 +760,7 @@ class acp_profile $lang_options[$lang_id]['lang_iso'] = $lang_iso; foreach ($options as $field => $field_type) { - $value = ($action == 'create') ? utf8_normalize_nfc(request_var('l_' . $field, array(0 => ''), true)) : $cp->vars['l_' . $field]; + $value = ($action == 'create') ? utf8_normalize_nfc($request->variable('l_' . $field, array(0 => ''), true)) : $cp->vars['l_' . $field]; if ($field == 'lang_options') { $var = (!isset($cp->vars['l_lang_options'][$lang_id]) || !is_array($cp->vars['l_lang_options'][$lang_id])) ? $cp->vars['lang_options'] : $cp->vars['l_lang_options'][$lang_id]; @@ -816,9 +816,9 @@ class acp_profile */ function save_profile_field(&$cp, $field_type, $action = 'create') { - global $db, $config, $user, $phpbb_container, $phpbb_log; + global $db, $config, $user, $phpbb_container, $phpbb_log, $request; - $field_id = request_var('field_id', 0); + $field_id = $request->variable('field_id', 0); // Collect all information, if something is going wrong, abort the operation $profile_sql = $profile_lang = $empty_lang = $profile_lang_fields = array(); diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php index 1e2c1fa9a5..5a97cf2169 100644 --- a/phpBB/includes/acp/acp_prune.php +++ b/phpBB/includes/acp/acp_prune.php @@ -51,11 +51,11 @@ class acp_prune */ function prune_forums($id, $mode) { - global $db, $user, $auth, $template, $cache, $phpbb_log; + global $db, $user, $auth, $template, $cache, $phpbb_log, $request; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; - $all_forums = request_var('all_forums', 0); - $forum_id = request_var('f', array(0)); + $all_forums = $request->variable('all_forums', 0); + $forum_id = $request->variable('f', array(0)); $submit = (isset($_POST['submit'])) ? true : false; if ($all_forums) @@ -77,14 +77,14 @@ class acp_prune { if (confirm_box(true)) { - $prune_posted = request_var('prune_days', 0); - $prune_viewed = request_var('prune_vieweddays', 0); + $prune_posted = $request->variable('prune_days', 0); + $prune_viewed = $request->variable('prune_vieweddays', 0); $prune_all = (!$prune_posted && !$prune_viewed) ? true : false; $prune_flags = 0; - $prune_flags += (request_var('prune_old_polls', 0)) ? 2 : 0; - $prune_flags += (request_var('prune_announce', 0)) ? 4 : 0; - $prune_flags += (request_var('prune_sticky', 0)) ? 8 : 0; + $prune_flags += ($request->variable('prune_old_polls', 0)) ? 2 : 0; + $prune_flags += ($request->variable('prune_announce', 0)) ? 4 : 0; + $prune_flags += ($request->variable('prune_sticky', 0)) ? 8 : 0; // Convert days to seconds for timestamp functions... $prunedate_posted = time() - ($prune_posted * 86400); @@ -169,11 +169,11 @@ class acp_prune 'all_forums' => $all_forums, 'f' => $forum_id, - 'prune_days' => request_var('prune_days', 0), - 'prune_vieweddays' => request_var('prune_vieweddays', 0), - 'prune_old_polls' => request_var('prune_old_polls', 0), - 'prune_announce' => request_var('prune_announce', 0), - 'prune_sticky' => request_var('prune_sticky', 0), + 'prune_days' => $request->variable('prune_days', 0), + 'prune_vieweddays' => $request->variable('prune_vieweddays', 0), + 'prune_old_polls' => $request->variable('prune_old_polls', 0), + 'prune_announce' => $request->variable('prune_announce', 0), + 'prune_sticky' => $request->variable('prune_sticky', 0), ))); } } @@ -229,7 +229,7 @@ class acp_prune */ function prune_users($id, $mode) { - global $db, $user, $auth, $template, $cache, $phpbb_log; + global $db, $user, $auth, $template, $cache, $phpbb_log, $request; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $user->add_lang('memberlist'); @@ -238,8 +238,8 @@ class acp_prune if ($prune) { - $action = request_var('action', 'deactivate'); - $deleteposts = request_var('deleteposts', 0); + $action = $request->variable('action', 'deactivate'); + $deleteposts = $request->variable('deleteposts', 0); if (confirm_box(true)) { @@ -311,8 +311,8 @@ class acp_prune 'mode' => $mode, 'prune' => 1, - 'deleteposts' => request_var('deleteposts', 0), - 'action' => request_var('action', ''), + 'deleteposts' => $request->variable('deleteposts', 0), + 'action' => $request->variable('action', ''), )), 'confirm_body_prune.html'); } } @@ -369,9 +369,9 @@ class acp_prune { global $user, $db, $request; - $users_by_name = request_var('users', '', true); - $users_by_id = request_var('user_ids', array(0)); - $group_id = request_var('group_id', 0); + $users_by_name = $request->variable('users', '', true); + $users_by_id = $request->variable('user_ids', array(0)); + $group_id = $request->variable('group_id', 0); $posts_on_queue = (trim($request->variable('posts_on_queue', '')) === '') ? false : $request->variable('posts_on_queue', 0); if ($users_by_name) @@ -388,15 +388,15 @@ class acp_prune } else { - $username = request_var('username', '', true); - $email = request_var('email', ''); - - $active_select = request_var('active_select', 'lt'); - $count_select = request_var('count_select', 'eq'); - $queue_select = request_var('queue_select', 'gt'); - $joined_before = request_var('joined_before', ''); - $joined_after = request_var('joined_after', ''); - $active = request_var('active', ''); + $username = $request->variable('username', '', true); + $email = $request->variable('email', ''); + + $active_select = $request->variable('active_select', 'lt'); + $count_select = $request->variable('count_select', 'eq'); + $queue_select = $request->variable('queue_select', 'gt'); + $joined_before = $request->variable('joined_before', ''); + $joined_after = $request->variable('joined_after', ''); + $active = $request->variable('active', ''); $count = ($request->variable('count', '') === '') ? false : $request->variable('count', 0); diff --git a/phpBB/includes/acp/acp_ranks.php b/phpBB/includes/acp/acp_ranks.php index b09d57056e..cfe604bd8a 100644 --- a/phpBB/includes/acp/acp_ranks.php +++ b/phpBB/includes/acp/acp_ranks.php @@ -31,10 +31,10 @@ class acp_ranks $user->add_lang('acp/posting'); // Set up general vars - $action = request_var('action', ''); + $action = $request->variable('action', ''); $action = (isset($_POST['add'])) ? 'add' : $action; $action = (isset($_POST['save'])) ? 'save' : $action; - $rank_id = request_var('id', 0); + $rank_id = $request->variable('id', 0); $this->tpl_name = 'acp_ranks'; $this->page_title = 'ACP_MANAGE_RANKS'; @@ -50,10 +50,10 @@ class acp_ranks { trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING); } - $rank_title = utf8_normalize_nfc(request_var('title', '', true)); - $special_rank = request_var('special_rank', 0); - $min_posts = ($special_rank) ? 0 : max(0, request_var('min_posts', 0)); - $rank_image = request_var('rank_image', ''); + $rank_title = utf8_normalize_nfc($request->variable('title', '', true)); + $special_rank = $request->variable('special_rank', 0); + $min_posts = ($special_rank) ? 0 : max(0, $request->variable('min_posts', 0)); + $rank_image = $request->variable('rank_image', ''); // The rank image has to be a jpg, gif or png if ($rank_image != '' && !preg_match('#(\.gif|\.png|\.jpg|\.jpeg)$#i', $rank_image)) diff --git a/phpBB/includes/acp/acp_reasons.php b/phpBB/includes/acp/acp_reasons.php index bb177dd85d..efc75eb970 100644 --- a/phpBB/includes/acp/acp_reasons.php +++ b/phpBB/includes/acp/acp_reasons.php @@ -32,9 +32,9 @@ class acp_reasons $user->add_lang(array('mcp', 'acp/posting')); // Set up general vars - $action = request_var('action', ''); + $action = $request->variable('action', ''); $submit = (isset($_POST['submit'])) ? true : false; - $reason_id = request_var('id', 0); + $reason_id = $request->variable('id', 0); $this->tpl_name = 'acp_reasons'; $this->page_title = 'ACP_REASONS'; @@ -50,8 +50,8 @@ class acp_reasons case 'edit': $reason_row = array( - 'reason_title' => utf8_normalize_nfc(request_var('reason_title', '', true)), - 'reason_description' => utf8_normalize_nfc(request_var('reason_description', '', true)), + 'reason_title' => utf8_normalize_nfc($request->variable('reason_title', '', true)), + 'reason_description' => utf8_normalize_nfc($request->variable('reason_description', '', true)), ); if ($submit) diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php index 0ca9e4d63d..f7382f826d 100644 --- a/phpBB/includes/acp/acp_search.php +++ b/phpBB/includes/acp/acp_search.php @@ -50,7 +50,7 @@ class acp_search function settings($id, $mode) { - global $db, $user, $auth, $template, $cache, $phpbb_log; + global $db, $user, $auth, $template, $cache, $phpbb_log, $request; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $submit = (isset($_POST['submit'])) ? true : false; @@ -104,8 +104,8 @@ class acp_search unset($search); unset($error); - $cfg_array = (isset($_REQUEST['config'])) ? request_var('config', array('' => ''), true) : array(); - $updated = request_var('updated', false); + $cfg_array = (isset($_REQUEST['config'])) ? $request->variable('config', array('' => ''), true) : array(); + $updated = $request->variable('updated', false); foreach ($settings as $config_name => $var_type) { @@ -232,10 +232,10 @@ class acp_search function index($id, $mode) { - global $db, $user, $auth, $template, $cache, $phpbb_log; + global $db, $user, $auth, $template, $cache, $phpbb_log, $request; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; - $action = request_var('action', ''); + $action = $request->variable('action', ''); $this->state = explode(',', $config['search_indexing_state']); if (isset($_POST['cancel'])) @@ -250,7 +250,7 @@ class acp_search switch ($action) { case 'progress_bar': - $type = request_var('type', ''); + $type = $request->variable('type', ''); $this->display_progress_bar($type); break; @@ -269,7 +269,7 @@ class acp_search if (empty($this->state[0])) { - $this->state[0] = request_var('search_type', ''); + $this->state[0] = $request->variable('search_type', ''); } $this->search = null; diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 0335d2364c..682d24afbc 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -40,9 +40,9 @@ class acp_users $this->tpl_name = 'acp_users'; $error = array(); - $username = utf8_normalize_nfc(request_var('username', '', true)); - $user_id = request_var('u', 0); - $action = request_var('action', ''); + $username = utf8_normalize_nfc($request->variable('username', '', true)); + $user_id = $request->variable('u', 0); + $action = $request->variable('action', ''); $submit = (isset($_POST['update']) && !isset($_POST['cancel'])) ? true : false; @@ -57,7 +57,7 @@ class acp_users $this->page_title = 'WHOIS'; $this->tpl_name = 'simple_body'; - $user_ip = phpbb_ip_normalise(request_var('user_ip', '')); + $user_ip = phpbb_ip_normalise($request->variable('user_ip', '')); $domain = gethostbyaddr($user_ip); $ipwhois = user_ipwhois($user_ip); @@ -169,9 +169,9 @@ class acp_users $user->add_lang('acp/ban'); - $delete = request_var('delete', 0); - $delete_type = request_var('delete_type', ''); - $ip = request_var('ip', 'ip'); + $delete = $request->variable('delete', 0); + $delete_type = $request->variable('delete_type', ''); + $ip = $request->variable('ip', 'ip'); /** * Run code at beginning of ACP users overview @@ -304,8 +304,8 @@ class acp_users break; } - $ban_reason = utf8_normalize_nfc(request_var('ban_reason', $user->lang[$reason], true)); - $ban_give_reason = utf8_normalize_nfc(request_var('ban_give_reason', '', true)); + $ban_reason = utf8_normalize_nfc($request->variable('ban_reason', $user->lang[$reason], true)); + $ban_give_reason = utf8_normalize_nfc($request->variable('ban_give_reason', '', true)); // Log not used at the moment, we simply utilize the ban function. $result = user_ban(substr($action, 3), $ban, 0, 0, 0, $ban_reason, $ban_give_reason); @@ -604,7 +604,7 @@ class acp_users $user->add_lang('acp/forums'); - $new_forum_id = request_var('new_f', 0); + $new_forum_id = $request->variable('new_f', 0); if (!$new_forum_id) { @@ -794,9 +794,9 @@ class acp_users // Handle registration info updates $data = array( - 'username' => utf8_normalize_nfc(request_var('user', $user_row['username'], true)), - 'user_founder' => request_var('user_founder', ($user_row['user_type'] == USER_FOUNDER) ? 1 : 0), - 'email' => strtolower(request_var('user_email', $user_row['user_email'])), + 'username' => utf8_normalize_nfc($request->variable('user', $user_row['username'], true)), + 'user_founder' => $request->variable('user_founder', ($user_row['user_type'] == USER_FOUNDER) ? 1 : 0), + 'email' => strtolower($request->variable('user_email', $user_row['user_email'])), 'new_password' => $request->variable('new_password', '', true), 'password_confirm' => $request->variable('password_confirm', '', true), ); @@ -1127,19 +1127,19 @@ class acp_users $user->add_lang('mcp'); // Set up general vars - $start = request_var('start', 0); + $start = $request->variable('start', 0); $deletemark = (isset($_POST['delmarked'])) ? true : false; $deleteall = (isset($_POST['delall'])) ? true : false; - $marked = request_var('mark', array(0)); - $message = utf8_normalize_nfc(request_var('message', '', true)); + $marked = $request->variable('mark', array(0)); + $message = utf8_normalize_nfc($request->variable('message', '', true)); /* @var $pagination \phpbb\pagination */ $pagination = $phpbb_container->get('pagination'); // Sort keys - $sort_days = request_var('st', 0); - $sort_key = request_var('sk', 't'); - $sort_dir = request_var('sd', 'd'); + $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) && $auth->acl_get('a_clearlogs')) @@ -1240,17 +1240,17 @@ class acp_users $user->add_lang('mcp'); // Set up general vars - $start = request_var('start', 0); + $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_var('mark', array(0)); - $message = utf8_normalize_nfc(request_var('message', '', true)); + $marked = $request->variable('mark', array(0)); + $message = utf8_normalize_nfc($request->variable('message', '', true)); // Sort keys - $sort_days = request_var('st', 0); - $sort_key = request_var('sk', 't'); - $sort_dir = request_var('sd', 'd'); + $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) @@ -1258,8 +1258,8 @@ class acp_users if (confirm_box(true)) { $where_sql = ''; - $deletemark = request_var('delmarked', 0); - $deleteall = request_var('delall', 0); + $deletemark = $request->variable('delmarked', 0); + $deleteall = $request->variable('delall', 0); if ($deletemark && $marked) { $where_sql = ' AND ' . $db->sql_in_set('warning_id', array_values($marked)); @@ -1398,7 +1398,7 @@ class acp_users $user_row['iso_lang_id'] = $row['lang_id']; $data = array( - 'jabber' => utf8_normalize_nfc(request_var('jabber', $user_row['user_jabber'], true)), + 'jabber' => utf8_normalize_nfc($request->variable('jabber', $user_row['user_jabber'], true)), 'bday_day' => 0, 'bday_month' => 0, 'bday_year' => 0, @@ -1409,9 +1409,9 @@ class acp_users list($data['bday_day'], $data['bday_month'], $data['bday_year']) = explode('-', $user_row['user_birthday']); } - $data['bday_day'] = request_var('bday_day', $data['bday_day']); - $data['bday_month'] = request_var('bday_month', $data['bday_month']); - $data['bday_year'] = request_var('bday_year', $data['bday_year']); + $data['bday_day'] = $request->variable('bday_day', $data['bday_day']); + $data['bday_month'] = $request->variable('bday_month', $data['bday_month']); + $data['bday_year'] = $request->variable('bday_year', $data['bday_year']); $data['user_birthday'] = sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']); /** @@ -1531,36 +1531,36 @@ class acp_users include($phpbb_root_path . 'includes/functions_user.' . $phpEx); $data = array( - 'dateformat' => utf8_normalize_nfc(request_var('dateformat', $user_row['user_dateformat'], true)), - 'lang' => basename(request_var('lang', $user_row['user_lang'])), - 'tz' => request_var('tz', $user_row['user_timezone']), - 'style' => request_var('style', $user_row['user_style']), - 'viewemail' => request_var('viewemail', $user_row['user_allow_viewemail']), - 'massemail' => request_var('massemail', $user_row['user_allow_massemail']), - 'hideonline' => request_var('hideonline', !$user_row['user_allow_viewonline']), - 'notifymethod' => request_var('notifymethod', $user_row['user_notify_type']), - 'notifypm' => request_var('notifypm', $user_row['user_notify_pm']), - 'allowpm' => request_var('allowpm', $user_row['user_allow_pm']), - - 'topic_sk' => request_var('topic_sk', ($user_row['user_topic_sortby_type']) ? $user_row['user_topic_sortby_type'] : 't'), - 'topic_sd' => request_var('topic_sd', ($user_row['user_topic_sortby_dir']) ? $user_row['user_topic_sortby_dir'] : 'd'), - 'topic_st' => request_var('topic_st', ($user_row['user_topic_show_days']) ? $user_row['user_topic_show_days'] : 0), - - 'post_sk' => request_var('post_sk', ($user_row['user_post_sortby_type']) ? $user_row['user_post_sortby_type'] : 't'), - 'post_sd' => request_var('post_sd', ($user_row['user_post_sortby_dir']) ? $user_row['user_post_sortby_dir'] : 'a'), - 'post_st' => request_var('post_st', ($user_row['user_post_show_days']) ? $user_row['user_post_show_days'] : 0), - - 'view_images' => request_var('view_images', $this->optionget($user_row, 'viewimg')), - 'view_flash' => request_var('view_flash', $this->optionget($user_row, 'viewflash')), - 'view_smilies' => request_var('view_smilies', $this->optionget($user_row, 'viewsmilies')), - 'view_sigs' => request_var('view_sigs', $this->optionget($user_row, 'viewsigs')), - 'view_avatars' => request_var('view_avatars', $this->optionget($user_row, 'viewavatars')), - 'view_wordcensor' => request_var('view_wordcensor', $this->optionget($user_row, 'viewcensors')), - - 'bbcode' => request_var('bbcode', $this->optionget($user_row, 'bbcode')), - 'smilies' => request_var('smilies', $this->optionget($user_row, 'smilies')), - 'sig' => request_var('sig', $this->optionget($user_row, 'attachsig')), - 'notify' => request_var('notify', $user_row['user_notify']), + 'dateformat' => utf8_normalize_nfc($request->variable('dateformat', $user_row['user_dateformat'], true)), + 'lang' => basename($request->variable('lang', $user_row['user_lang'])), + 'tz' => $request->variable('tz', $user_row['user_timezone']), + 'style' => $request->variable('style', $user_row['user_style']), + 'viewemail' => $request->variable('viewemail', $user_row['user_allow_viewemail']), + 'massemail' => $request->variable('massemail', $user_row['user_allow_massemail']), + 'hideonline' => $request->variable('hideonline', !$user_row['user_allow_viewonline']), + 'notifymethod' => $request->variable('notifymethod', $user_row['user_notify_type']), + 'notifypm' => $request->variable('notifypm', $user_row['user_notify_pm']), + 'allowpm' => $request->variable('allowpm', $user_row['user_allow_pm']), + + 'topic_sk' => $request->variable('topic_sk', ($user_row['user_topic_sortby_type']) ? $user_row['user_topic_sortby_type'] : 't'), + 'topic_sd' => $request->variable('topic_sd', ($user_row['user_topic_sortby_dir']) ? $user_row['user_topic_sortby_dir'] : 'd'), + 'topic_st' => $request->variable('topic_st', ($user_row['user_topic_show_days']) ? $user_row['user_topic_show_days'] : 0), + + 'post_sk' => $request->variable('post_sk', ($user_row['user_post_sortby_type']) ? $user_row['user_post_sortby_type'] : 't'), + 'post_sd' => $request->variable('post_sd', ($user_row['user_post_sortby_dir']) ? $user_row['user_post_sortby_dir'] : 'a'), + 'post_st' => $request->variable('post_st', ($user_row['user_post_show_days']) ? $user_row['user_post_show_days'] : 0), + + 'view_images' => $request->variable('view_images', $this->optionget($user_row, 'viewimg')), + 'view_flash' => $request->variable('view_flash', $this->optionget($user_row, 'viewflash')), + 'view_smilies' => $request->variable('view_smilies', $this->optionget($user_row, 'viewsmilies')), + 'view_sigs' => $request->variable('view_sigs', $this->optionget($user_row, 'viewsigs')), + 'view_avatars' => $request->variable('view_avatars', $this->optionget($user_row, 'viewavatars')), + 'view_wordcensor' => $request->variable('view_wordcensor', $this->optionget($user_row, 'viewcensors')), + + 'bbcode' => $request->variable('bbcode', $this->optionget($user_row, 'bbcode')), + 'smilies' => $request->variable('smilies', $this->optionget($user_row, 'smilies')), + 'sig' => $request->variable('sig', $this->optionget($user_row, 'attachsig')), + 'notify' => $request->variable('notify', $user_row['user_notify']), ); /** @@ -1921,7 +1921,7 @@ class acp_users trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); } - $rank_id = request_var('user_rank', 0); + $rank_id = $request->variable('user_rank', 0); $sql = 'UPDATE ' . USERS_TABLE . " SET user_rank = $rank_id @@ -2053,13 +2053,13 @@ class acp_users /* @var $pagination \phpbb\pagination */ $pagination = $phpbb_container->get('pagination'); - $start = request_var('start', 0); + $start = $request->variable('start', 0); $deletemark = (isset($_POST['delmarked'])) ? true : false; - $marked = request_var('mark', array(0)); + $marked = $request->variable('mark', array(0)); // Sort keys - $sort_key = request_var('sk', 'a'); - $sort_dir = request_var('sd', 'd'); + $sort_key = $request->variable('sk', 'a'); + $sort_dir = $request->variable('sd', 'd'); if ($deletemark && sizeof($marked)) { @@ -2207,7 +2207,7 @@ class acp_users include($phpbb_root_path . 'includes/functions_user.' . $phpEx); $user->add_lang(array('groups', 'acp/groups')); - $group_id = request_var('g', 0); + $group_id = $request->variable('g', 0); if ($group_id) { @@ -2427,7 +2427,7 @@ class acp_users $user->add_lang('acp/permissions'); add_permission_language(); - $forum_id = request_var('f', 0); + $forum_id = $request->variable('f', 0); // Global Permissions if (!$forum_id) diff --git a/phpBB/includes/acp/acp_words.php b/phpBB/includes/acp/acp_words.php index 5f387c98a7..eef9199130 100644 --- a/phpBB/includes/acp/acp_words.php +++ b/phpBB/includes/acp/acp_words.php @@ -28,13 +28,13 @@ class acp_words function main($id, $mode) { - global $db, $user, $auth, $template, $cache, $phpbb_log; + global $db, $user, $auth, $template, $cache, $phpbb_log, $request; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $user->add_lang('acp/posting'); // Set up general vars - $action = request_var('action', ''); + $action = $request->variable('action', ''); $action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['save'])) ? 'save' : $action); $s_hidden_fields = ''; @@ -50,7 +50,7 @@ class acp_words { case 'edit': - $word_id = request_var('id', 0); + $word_id = $request->variable('id', 0); if (!$word_id) { @@ -88,9 +88,9 @@ class acp_words trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING); } - $word_id = request_var('id', 0); - $word = utf8_normalize_nfc(request_var('word', '', true)); - $replacement = utf8_normalize_nfc(request_var('replacement', '', true)); + $word_id = $request->variable('id', 0); + $word = utf8_normalize_nfc($request->variable('word', '', true)); + $replacement = utf8_normalize_nfc($request->variable('replacement', '', true)); if ($word === '' || $replacement === '') { @@ -127,7 +127,7 @@ class acp_words case 'delete': - $word_id = request_var('id', 0); + $word_id = $request->variable('id', 0); if (!$word_id) { diff --git a/phpBB/includes/compatibility_globals.php b/phpBB/includes/compatibility_globals.php index 996949809c..b0919aefb3 100644 --- a/phpBB/includes/compatibility_globals.php +++ b/phpBB/includes/compatibility_globals.php @@ -38,9 +38,6 @@ $auth = $phpbb_container->get('auth'); /* @var $db \phpbb\db\driver\driver_interface */ $db = $phpbb_container->get('dbal.conn'); -// make sure request_var uses this request instance -request_var('', 0, false, false, $request); // "dependency injection" for a function - // Grab global variables, re-cache if necessary /* @var $config phpbb\config\db */ $config = $phpbb_container->get('config'); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 9535d2a735..ce2528750e 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -64,72 +64,6 @@ function set_var(&$result, $var, $type, $multibyte = false) } /** -* Wrapper function of \phpbb\request\request::variable which exists for backwards compatability. -* See {@link \phpbb\request\request_interface::variable \phpbb\request\request_interface::variable} for -* documentation of this function's use. -* -* @deprecated -* @param mixed $var_name The form variable's name from which data shall be retrieved. -* If the value is an array this may be an array of indizes which will give -* direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a") -* then specifying array("var", 1) as the name will return "a". -* If you pass an instance of {@link \phpbb\request\request_interface phpbb_request_interface} -* as this parameter it will overwrite the current request class instance. If you do -* not do so, it will create its own instance (but leave superglobals enabled). -* @param mixed $default A default value that is returned if the variable was not set. -* This function will always return a value of the same type as the default. -* @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters -* Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks -* @param bool $cookie This param is mapped to \phpbb\request\request_interface::COOKIE as the last param for -* \phpbb\request\request_interface::variable for backwards compatability reasons. -* @param \phpbb\request\request_interface|null|false If an instance of \phpbb\request\request_interface is given the instance is stored in -* a static variable and used for all further calls where this parameters is null. Until -* the function is called with an instance it automatically creates a new \phpbb\request\request -* instance on every call. By passing false this per-call instantiation can be restored -* after having passed in a \phpbb\request\request_interface instance. -* -* @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the -* the same as that of $default. If the variable is not set $default is returned. -*/ -function request_var($var_name, $default, $multibyte = false, $cookie = false, $request = null) -{ - // This is all just an ugly hack to add "Dependency Injection" to a function - // the only real code is the function call which maps this function to a method. - static $static_request = null; - - if ($request instanceof \phpbb\request\request_interface) - { - $static_request = $request; - - if (empty($var_name)) - { - return; - } - } - else if ($request === false) - { - $static_request = null; - - if (empty($var_name)) - { - return; - } - } - - $tmp_request = $static_request; - - // no request class set, create a temporary one ourselves to keep backwards compatability - if ($tmp_request === null) - { - // false param: enable super globals, so the created request class does not - // make super globals inaccessible everywhere outside this function. - $tmp_request = new \phpbb\request\request(new \phpbb\request\type_cast_helper(), false); - } - - return $tmp_request->variable($var_name, $default, $multibyte, ($cookie) ? \phpbb\request\request_interface::COOKIE : \phpbb\request\request_interface::REQUEST); -} - -/** * Generates an alphanumeric random string of given length * * @return string @@ -1618,7 +1552,7 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis */ function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $sql_limit = 1001, $sql_limit_offset = 0) { - global $config, $db, $user; + global $config, $db, $user, $request; global $phpbb_dispatcher; $user_id = ($user_id === false) ? (int) $user->data['user_id'] : (int) $user_id; @@ -1697,7 +1631,7 @@ function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $s if (empty($tracking_topics)) { - $tracking_topics = request_var($config['cookie_name'] . '_track', '', false, true); + $tracking_topics = $request->variable($config['cookie_name'] . '_track', '', false, \phpbb\request\request_interface::COOKIE); $tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array(); } @@ -2640,9 +2574,9 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo if ($check && $confirm) { - $user_id = request_var('confirm_uid', 0); - $session_id = request_var('sess', ''); - $confirm_key = request_var('confirm_key', ''); + $user_id = $request->variable('confirm_uid', 0); + $session_id = $request->variable('sess', ''); + $confirm_key = $request->variable('confirm_key', ''); if ($user_id != $user->data['user_id'] || $session_id != $user->session_id || !$confirm_key || !$user->data['user_last_confirm_key'] || $confirm_key != $user->data['user_last_confirm_key']) { @@ -2684,7 +2618,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo ); // If activation key already exist, we better do not re-use the key (something very strange is going on...) - if (request_var('confirm_key', '')) + if ($request->variable('confirm_key', '')) { // This should not occur, therefore we cancel the operation to safe the user return false; @@ -2767,7 +2701,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa // Get credential if ($admin) { - $credential = request_var('credential', ''); + $credential = $request->variable('credential', ''); if (strspn($credential, 'abcdef0123456789') !== strlen($credential) || strlen($credential) != 32) { @@ -2785,7 +2719,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa $password = $request->untrimmed_variable('password', '', true); } - $username = request_var('username', '', true); + $username = $request->variable('username', '', true); $autologin = $request->is_set_post('autologin'); $viewonline = (int) !$request->is_set_post('viewonline'); $admin = ($admin) ? 1 : 0; @@ -2824,7 +2758,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa // The result parameter is always an array, holding the relevant information... if ($result['status'] == LOGIN_SUCCESS) { - $redirect = request_var('redirect', "{$phpbb_root_path}index.$phpEx"); + $redirect = $request->variable('redirect', "{$phpbb_root_path}index.$phpEx"); /** * This event allows an extension to modify the redirection when a user successfully logs in @@ -4808,8 +4742,8 @@ function page_header($page_title = '', $display_online_list = false, $item_id = } } - $forum_id = request_var('f', 0); - $topic_id = request_var('t', 0); + $forum_id = $request->variable('f', 0); + $topic_id = $request->variable('t', 0); $s_feed_news = false; diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php index 2673f74a62..8d9f5018fa 100644 --- a/phpBB/includes/functions_compatibility.php +++ b/phpBB/includes/functions_compatibility.php @@ -324,3 +324,63 @@ function set_config_count($config_name, $increment, $is_dynamic = false, \phpbb\ } $config->increment($config_name, $increment, !$is_dynamic); } + +/** + * Wrapper function of \phpbb\request\request::variable which exists for backwards compatability. + * See {@link \phpbb\request\request_interface::variable \phpbb\request\request_interface::variable} for + * documentation of this function's use. + * + * @deprecated 3.1.0 (To be removed: 3.3.0) + * @param mixed $var_name The form variable's name from which data shall be retrieved. + * If the value is an array this may be an array of indizes which will give + * direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a") + * then specifying array("var", 1) as the name will return "a". + * If you pass an instance of {@link \phpbb\request\request_interface phpbb_request_interface} + * as this parameter it will overwrite the current request class instance. If you do + * not do so, it will create its own instance (but leave superglobals enabled). + * @param mixed $default A default value that is returned if the variable was not set. + * This function will always return a value of the same type as the default. + * @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters + * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks + * @param bool $cookie This param is mapped to \phpbb\request\request_interface::COOKIE as the last param for + * \phpbb\request\request_interface::variable for backwards compatability reasons. + * @param \phpbb\request\request_interface|null|false If an instance of \phpbb\request\request_interface is given the instance is stored in + * a static variable and used for all further calls where this parameters is null. Until + * the function is called with an instance it automatically creates a new \phpbb\request\request + * instance on every call. By passing false this per-call instantiation can be restored + * after having passed in a \phpbb\request\request_interface instance. + * + * @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the + * the same as that of $default. If the variable is not set $default is returned. + */ +function request_var($var_name, $default, $multibyte = false, $cookie = false, $request = null) +{ + // This is all just an ugly hack to add "Dependency Injection" to a function + // the only real code is the function call which maps this function to a method. + static $static_request = null; + if ($request instanceof \phpbb\request\request_interface) + { + $static_request = $request; + if (empty($var_name)) + { + return; + } + } + else if ($request === false) + { + $static_request = null; + if (empty($var_name)) + { + return; + } + } + $tmp_request = $static_request; + // no request class set, create a temporary one ourselves to keep backwards compatibility + if ($tmp_request === null) + { + // false param: enable super globals, so the created request class does not + // make super globals inaccessible everywhere outside this function. + $tmp_request = new \phpbb\request\request(new \phpbb\request\type_cast_helper(), false); + } + return $tmp_request->variable($var_name, $default, $multibyte, ($cookie) ? \phpbb\request\request_interface::COOKIE : \phpbb\request\request_interface::REQUEST); +} diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 2810a23c05..1d208a272b 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -33,7 +33,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $sql_from = ''; // Mark forums read? - $mark_read = request_var('mark', ''); + $mark_read = $request->variable('mark', ''); if ($mark_read == 'all') { @@ -61,9 +61,9 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $redirect = build_url(array('mark', 'hash', 'mark_time')); meta_refresh(3, $redirect); - if (check_link_hash(request_var('hash', ''), 'global')) + if (check_link_hash($request->variable('hash', ''), 'global')) { - markread('all', false, false, request_var('mark_time', 0)); + markread('all', false, false, $request->variable('mark_time', 0)); if ($request->is_ajax()) { @@ -334,10 +334,10 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod if ($mark_read == 'forums') { $redirect = build_url(array('mark', 'hash', 'mark_time')); - $token = request_var('hash', ''); + $token = $request->variable('hash', ''); if (check_link_hash($token, 'global')) { - markread('topics', $forum_ids, false, request_var('mark_time', 0)); + markread('topics', $forum_ids, false, $request->variable('mark_time', 0)); $message = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect . '">', '</a>'); meta_refresh(3, $redirect); @@ -1267,8 +1267,8 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, { if (isset($_GET['unwatch'])) { - $uid = request_var('uid', 0); - $token = request_var('hash', ''); + $uid = $request->variable('uid', 0); + $token = $request->variable('hash', ''); if ($token && check_link_hash($token, "{$mode}_$match_id") || confirm_box(true)) { @@ -1341,8 +1341,8 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, { if (isset($_GET['watch'])) { - $uid = request_var('uid', 0); - $token = request_var('hash', ''); + $uid = $request->variable('uid', 0); + $token = $request->variable('hash', ''); if ($token && check_link_hash($token, "{$mode}_$match_id") || confirm_box(true)) { diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php index 254e65ae3d..6aabfdf641 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; + global $user, $db, $config, $phpbb_root_path, $request; $filename = $phpbb_root_path . $upload_dir . '/' . $attachment['physical_filename']; @@ -185,7 +185,7 @@ function send_file_to_browser($attachment, $upload_dir, $category) header('X-Content-Type-Options: nosniff'); } - if ($category == ATTACHMENT_CATEGORY_FLASH && request_var('view', 0) === 1) + if ($category == ATTACHMENT_CATEGORY_FLASH && $request->variable('view', 0) === 1) { // We use content-disposition: inline for flash files and view=1 to let it correctly play with flash player 10 - any other disposition will fail to play inline header('Content-Disposition: inline'); diff --git a/phpBB/includes/functions_mcp.php b/phpBB/includes/functions_mcp.php index 8d09a3dea2..f17a088d64 100644 --- a/phpBB/includes/functions_mcp.php +++ b/phpBB/includes/functions_mcp.php @@ -369,9 +369,9 @@ function phpbb_get_pm_data($pm_ids) */ function phpbb_mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, &$sort_order_sql, &$total, $forum_id = 0, $topic_id = 0, $where_sql = 'WHERE') { - global $db, $user, $auth, $template; + global $db, $user, $auth, $template, $request; - $sort_days = request_var('st', 0); + $sort_days = $request->variable('st', 0); $min_time = ($sort_days) ? time() - ($sort_days * 86400) : 0; switch ($mode) @@ -512,8 +512,8 @@ function phpbb_mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by break; } - $sort_key = request_var('sk', $default_key); - $sort_dir = request_var('sd', $default_dir); + $sort_key = $request->variable('sk', $default_key); + $sort_dir = $request->variable('sd', $default_dir); $sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']); switch ($type) diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index fe9bcdb9d1..d0d09fe9fb 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -480,13 +480,15 @@ class p_master */ function set_active($id = false, $mode = false) { + global $request; + $icat = false; $this->active_module = false; - if (request_var('icat', '')) + if ($request->variable('icat', '')) { $icat = $id; - $id = request_var('icat', ''); + $id = $request->variable('icat', ''); } // Restore the backslashes in class names @@ -553,10 +555,10 @@ class p_master */ function load_active($mode = false, $module_url = false, $execute_module = true) { - global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user, $template; + global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user, $template, $request; $module_path = $this->include_path . $this->p_class; - $icat = request_var('icat', ''); + $icat = $request->variable('icat', ''); if ($this->active_module === false) { diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 38d4df703f..b93a89e773 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -24,13 +24,13 @@ if (!defined('IN_PHPBB')) */ function generate_smilies($mode, $forum_id) { - global $db, $user, $config, $template, $phpbb_dispatcher; + global $db, $user, $config, $template, $phpbb_dispatcher, $request; global $phpEx, $phpbb_root_path, $phpbb_container, $phpbb_path_helper; /* @var $pagination \phpbb\pagination */ $pagination = $phpbb_container->get('pagination'); $base_url = append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&f=' . $forum_id); - $start = request_var('start', 0); + $start = $request->variable('start', 0); if ($mode == 'window') { @@ -1520,7 +1520,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $ */ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $update_message = true, $update_search_index = true) { - global $db, $auth, $user, $config, $phpEx, $template, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher, $phpbb_log; + global $db, $auth, $user, $config, $phpEx, $template, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher, $phpbb_log, $request; /** * Modify the data for post submitting @@ -2207,7 +2207,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u $db->sql_transaction('commit'); // Delete draft if post was loaded... - $draft_id = request_var('draft_loaded', 0); + $draft_id = $request->variable('draft_loaded', 0); if ($draft_id) { $sql = 'DELETE FROM ' . DRAFTS_TABLE . " diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 1c63338247..ab0f092f87 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -938,10 +938,10 @@ function mark_folder_read($user_id, $folder_id) */ function handle_mark_actions($user_id, $mark_action) { - global $db, $user, $phpbb_root_path, $phpEx; + global $db, $user, $phpbb_root_path, $phpEx, $request; - $msg_ids = request_var('marked_msg_id', array(0)); - $cur_folder_id = request_var('cur_folder_id', PRIVMSGS_NO_BOX); + $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)) @@ -1611,7 +1611,7 @@ function get_folder_status($folder_id, $folder) */ function submit_pm($mode, $subject, &$data, $put_in_outbox = true) { - global $db, $auth, $config, $phpEx, $template, $user, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher; + global $db, $auth, $config, $phpEx, $template, $user, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher, $request; // We do not handle erasing pms here if ($mode == 'delete') @@ -1911,7 +1911,7 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true) } // Delete draft if post was loaded... - $draft_id = request_var('draft_loaded', 0); + $draft_id = $request->variable('draft_loaded', 0); if ($draft_id) { $sql = 'DELETE FROM ' . DRAFTS_TABLE . " diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index be17d7fe47..9a280c0ea5 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -45,11 +45,11 @@ function mcp_forum_view($id, $mode, $action, $forum_info) } $forum_id = $forum_info['forum_id']; - $start = request_var('start', 0); - $topic_id_list = request_var('topic_id_list', array(0)); - $post_id_list = request_var('post_id_list', array(0)); - $source_topic_ids = array(request_var('t', 0)); - $to_topic_id = request_var('to_topic_id', 0); + $start = $request->variable('start', 0); + $topic_id_list = $request->variable('topic_id_list', array(0)); + $post_id_list = $request->variable('post_id_list', array(0)); + $source_topic_ids = array($request->variable('t', 0)); + $to_topic_id = $request->variable('to_topic_id', 0); $url_extra = ''; $url_extra .= ($forum_id) ? "&f=$forum_id" : ''; @@ -63,7 +63,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) switch ($action) { case 'resync': - $topic_ids = request_var('topic_id_list', array(0)); + $topic_ids = $request->variable('topic_id_list', array(0)); mcp_resync_topics($topic_ids); break; @@ -339,7 +339,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; + global $auth, $db, $template, $phpEx, $user, $phpbb_root_path, $phpbb_log, $request; if (!sizeof($topic_ids)) { @@ -374,7 +374,7 @@ function mcp_resync_topics($topic_ids) $msg = (sizeof($topic_ids) == 1) ? $user->lang['TOPIC_RESYNC_SUCCESS'] : $user->lang['TOPICS_RESYNC_SUCCESS']; - $redirect = request_var('redirect', $user->data['session_page']); + $redirect = $request->variable('redirect', $user->data['session_page']); meta_refresh(3, $redirect); trigger_error($msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>')); @@ -387,7 +387,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; + global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $phpbb_log, $request; if (!sizeof($topic_ids)) { @@ -418,8 +418,8 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id) $topic_data = $topic_data[$to_topic_id]; - $post_id_list = request_var('post_id_list', array(0)); - $start = request_var('start', 0); + $post_id_list = $request->variable('post_id_list', array(0)); + $start = $request->variable('start', 0); if (!sizeof($post_id_list) && sizeof($topic_ids)) { @@ -447,7 +447,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id) return; } - $redirect = request_var('redirect', build_url(array('quickmod'))); + $redirect = $request->variable('redirect', build_url(array('quickmod'))); $s_hidden_fields = build_hidden_fields(array( 'i' => 'main', @@ -496,7 +496,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id) // Link to the new topic $return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&t=' . $to_topic_id) . '">', '</a>'); - $redirect = request_var('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&t=$to_topic_id"); + $redirect = $request->variable('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&t=$to_topic_id"); $redirect = reapply_sid($redirect); meta_refresh(3, $redirect); diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index 500db55456..ea17f55402 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -26,7 +26,7 @@ function mcp_front_view($id, $mode, $action) { global $phpEx, $phpbb_root_path, $config; global $template, $db, $user, $auth, $module; - global $phpbb_dispatcher; + global $phpbb_dispatcher, $request; // Latest 5 unapproved if ($module->loaded('queue')) @@ -35,7 +35,7 @@ function mcp_front_view($id, $mode, $action) $post_list = array(); $forum_names = array(); - $forum_id = request_var('f', 0); + $forum_id = $request->variable('f', 0); $template->assign_var('S_SHOW_UNAPPROVED', (!empty($forum_list)) ? true : false); diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php index db55010adb..493ba3cb3d 100644 --- a/phpBB/includes/mcp/mcp_logs.php +++ b/phpBB/includes/mcp/mcp_logs.php @@ -35,12 +35,12 @@ class mcp_logs function main($id, $mode) { - global $auth, $db, $user, $template; + global $auth, $db, $user, $template, $request; global $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_log; $user->add_lang('acp/common'); - $action = request_var('action', array('' => '')); + $action = $request->variable('action', array('' => '')); if (is_array($action)) { @@ -48,19 +48,19 @@ class mcp_logs } else { - $action = request_var('action', ''); + $action = $request->variable('action', ''); } // Set up general vars - $start = request_var('start', 0); + $start = $request->variable('start', 0); $deletemark = ($action == 'del_marked') ? true : false; $deleteall = ($action == 'del_all') ? true : false; - $marked = request_var('mark', array(0)); + $marked = $request->variable('mark', array(0)); // Sort keys - $sort_days = request_var('st', 0); - $sort_key = request_var('sk', 't'); - $sort_dir = request_var('sd', 'd'); + $sort_days = $request->variable('st', 0); + $sort_key = $request->variable('sk', 't'); + $sort_dir = $request->variable('sd', 'd'); $this->tpl_name = 'mcp_logs'; $this->page_title = 'MCP_LOGS'; @@ -79,7 +79,7 @@ class mcp_logs break; case 'forum_logs': - $forum_id = request_var('f', 0); + $forum_id = $request->variable('f', 0); if (!in_array($forum_id, $forum_list)) { @@ -90,7 +90,7 @@ class mcp_logs break; case 'topic_logs': - $topic_id = request_var('t', 0); + $topic_id = $request->variable('t', 0); $sql = 'SELECT forum_id FROM ' . TOPICS_TABLE . ' @@ -124,7 +124,7 @@ class mcp_logs } else if ($deleteall) { - $keywords = utf8_normalize_nfc(request_var('keywords', '', true)); + $keywords = utf8_normalize_nfc($request->variable('keywords', '', true)); $conditions = array( 'forum_id' => array('IN' => $forum_list), @@ -158,7 +158,7 @@ class mcp_logs 'sd' => $sort_dir, 'i' => $id, 'mode' => $mode, - 'action' => request_var('action', array('' => '')))) + 'action' => $request->variable('action', array('' => '')))) ); } } @@ -175,7 +175,7 @@ class mcp_logs $sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0; $sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); - $keywords = utf8_normalize_nfc(request_var('keywords', '', true)); + $keywords = utf8_normalize_nfc($request->variable('keywords', '', true)); $keywords_param = !empty($keywords) ? '&keywords=' . urlencode(htmlspecialchars_decode($keywords)) : ''; // Grab log data diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 8bf6bf8c0c..e3fbbc0418 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -45,7 +45,7 @@ class mcp_main { case 'lock': case 'unlock': - $topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0)); + $topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0)); if (!sizeof($topic_ids)) { @@ -58,7 +58,7 @@ class mcp_main case 'lock_post': case 'unlock_post': - $post_ids = (!$quickmod) ? request_var('post_id_list', array(0)) : array(request_var('p', 0)); + $post_ids = (!$quickmod) ? $request->variable('post_id_list', array(0)) : array($request->variable('p', 0)); if (!sizeof($post_ids)) { @@ -73,7 +73,7 @@ class mcp_main case 'make_global': case 'make_normal': - $topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0)); + $topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0)); if (!sizeof($topic_ids)) { @@ -86,7 +86,7 @@ class mcp_main case 'move': $user->add_lang('viewtopic'); - $topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0)); + $topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0)); if (!sizeof($topic_ids)) { @@ -99,7 +99,7 @@ class mcp_main case 'fork': $user->add_lang('viewtopic'); - $topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0)); + $topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0)); if (!sizeof($topic_ids)) { @@ -189,7 +189,7 @@ class mcp_main $user->add_lang('viewforum'); - $forum_id = request_var('f', 0); + $forum_id = $request->variable('f', 0); $forum_info = phpbb_get_forum_data($forum_id, 'm_', true); @@ -273,7 +273,7 @@ function lock_unlock($action, $ids) } unset($orig_ids); - $redirect = request_var('redirect', build_url(array('action', 'quickmod'))); + $redirect = $request->variable('redirect', build_url(array('action', 'quickmod'))); $redirect = reapply_sid($redirect); $s_hidden_fields = build_hidden_fields(array( @@ -361,7 +361,7 @@ function change_topic_type($action, $topic_ids) return; } - $redirect = request_var('redirect', build_url(array('action', 'quickmod'))); + $redirect = $request->variable('redirect', build_url(array('action', 'quickmod'))); $redirect = reapply_sid($redirect); $s_hidden_fields = array( @@ -441,8 +441,8 @@ function mcp_move_topic($topic_ids) return; } - $to_forum_id = request_var('to_forum_id', 0); - $redirect = request_var('redirect', build_url(array('action', 'quickmod'))); + $to_forum_id = $request->variable('to_forum_id', 0); + $redirect = $request->variable('redirect', build_url(array('action', 'quickmod'))); $additional_msg = $success_msg = ''; $s_hidden_fields = build_hidden_fields(array( @@ -662,7 +662,7 @@ function mcp_move_topic($topic_ids) confirm_box(false, 'MOVE_TOPIC' . ((sizeof($topic_ids) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_move.html'); } - $redirect = request_var('redirect', "index.$phpEx"); + $redirect = $request->variable('redirect', "index.$phpEx"); $redirect = reapply_sid($redirect); if (!$success_msg) @@ -1163,16 +1163,16 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '', function mcp_fork_topic($topic_ids) { global $auth, $user, $db, $template, $config; - global $phpEx, $phpbb_root_path, $phpbb_log; + global $phpEx, $phpbb_root_path, $phpbb_log, $request; if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_'))) { return; } - $to_forum_id = request_var('to_forum_id', 0); - $forum_id = request_var('f', 0); - $redirect = request_var('redirect', build_url(array('action', 'quickmod'))); + $to_forum_id = $request->variable('to_forum_id', 0); + $forum_id = $request->variable('f', 0); + $redirect = $request->variable('redirect', build_url(array('action', 'quickmod'))); $additional_msg = $success_msg = ''; $counter = array(); @@ -1541,7 +1541,7 @@ function mcp_fork_topic($topic_ids) confirm_box(false, 'FORK_TOPIC' . ((sizeof($topic_ids) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_move.html'); } - $redirect = request_var('redirect', "index.$phpEx"); + $redirect = $request->variable('redirect', "index.$phpEx"); $redirect = reapply_sid($redirect); if (!$success_msg) diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php index 4fd17ccf48..ec7dcaada3 100644 --- a/phpBB/includes/mcp/mcp_notes.php +++ b/phpBB/includes/mcp/mcp_notes.php @@ -35,10 +35,10 @@ class mcp_notes function main($id, $mode) { - global $auth, $db, $user, $template; + global $auth, $db, $user, $template, $request; global $config, $phpbb_root_path, $phpEx; - $action = request_var('action', array('' => '')); + $action = $request->variable('action', array('' => '')); if (is_array($action)) { @@ -74,15 +74,15 @@ class mcp_notes */ function mcp_notes_user_view($action) { - global $phpEx, $phpbb_root_path, $config, $phpbb_log; + global $phpEx, $phpbb_root_path, $config, $phpbb_log, $request; global $template, $db, $user, $auth, $phpbb_container; - $user_id = request_var('u', 0); - $username = request_var('username', '', true); - $start = request_var('start', 0); - $st = request_var('st', 0); - $sk = request_var('sk', 'b'); - $sd = request_var('sd', 'd'); + $user_id = $request->variable('u', 0); + $username = $request->variable('username', '', true); + $start = $request->variable('start', 0); + $st = $request->variable('st', 0); + $sk = $request->variable('sk', 'b'); + $sd = $request->variable('sd', 'd'); /* @var $pagination \phpbb\pagination */ $pagination = $phpbb_container->get('pagination'); @@ -116,8 +116,8 @@ class mcp_notes $deletemark = ($action == 'del_marked') ? true : false; $deleteall = ($action == 'del_all') ? true : false; - $marked = request_var('marknote', array(0)); - $usernote = utf8_normalize_nfc(request_var('usernote', '', true)); + $marked = $request->variable('marknote', array(0)); + $usernote = utf8_normalize_nfc($request->variable('usernote', '', true)); // Handle any actions if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs')) @@ -201,7 +201,7 @@ class mcp_notes $sql_where = ($st) ? (time() - ($st * 86400)) : 0; $sql_sort = $sort_by_sql[$sk] . ' ' . (($sd == 'd') ? 'DESC' : 'ASC'); - $keywords = utf8_normalize_nfc(request_var('keywords', '', true)); + $keywords = utf8_normalize_nfc($request->variable('keywords', '', true)); $keywords_param = !empty($keywords) ? '&keywords=' . urlencode(htmlspecialchars_decode($keywords)) : ''; $log_data = array(); diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php index bd0edafa84..cc8e48dc91 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; + global $auth, $db, $user, $template, $cache, $request; global $config, $phpbb_root_path, $phpEx, $action, $phpbb_container; include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); @@ -43,7 +43,7 @@ class mcp_pm_reports /* @var $pagination \phpbb\pagination */ $pagination = $phpbb_container->get('pagination'); - $start = request_var('start', 0); + $start = $request->variable('start', 0); $this->page_title = 'MCP_PM_REPORTS'; @@ -53,7 +53,7 @@ class mcp_pm_reports case 'delete': include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); - $report_id_list = request_var('report_id_list', array(0)); + $report_id_list = $request->variable('report_id_list', array(0)); if (!sizeof($report_id_list)) { @@ -76,7 +76,7 @@ class mcp_pm_reports $user->add_lang(array('posting', 'viewforum', 'viewtopic', 'ucp')); - $report_id = request_var('r', 0); + $report_id = $request->variable('r', 0); $sql = 'SELECT r.pm_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour FROM ' . REPORTS_TABLE . ' r, ' . REPORTS_REASONS_TABLE . ' rr, ' . USERS_TABLE . ' u @@ -201,7 +201,7 @@ class mcp_pm_reports 'POST_SUBJECT' => ($pm_info['message_subject']) ? $pm_info['message_subject'] : $user->lang['NO_SUBJECT'], 'POST_DATE' => $user->format_date($pm_info['message_time']), 'POST_IP' => $pm_info['author_ip'], - 'POST_IPADDR' => ($auth->acl_getf_global('m_info') && request_var('lookup', '')) ? @gethostbyaddr($pm_info['author_ip']) : '', + 'POST_IPADDR' => ($auth->acl_getf_global('m_info') && $request->variable('lookup', '')) ? @gethostbyaddr($pm_info['author_ip']) : '', 'POST_ID' => $pm_info['msg_id'], 'U_LOOKUP_IP' => ($auth->acl_getf_global('m_info')) ? $this->u_action . '&r=' . $report_id . '&pm=' . $pm_id . '&lookup=' . $pm_info['author_ip'] . '#ip' : '', diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index c5f89cddef..b70dfbb514 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -24,13 +24,13 @@ if (!defined('IN_PHPBB')) */ function mcp_post_details($id, $mode, $action) { - global $phpEx, $phpbb_root_path, $config; + global $phpEx, $phpbb_root_path, $config, $request; global $template, $db, $user, $auth, $cache; $user->add_lang('posting'); - $post_id = request_var('p', 0); - $start = request_var('start', 0); + $post_id = $request->variable('p', 0); + $start = $request->variable('start', 0); // Get post data $post_info = phpbb_get_post_data(array($post_id), false, true); @@ -51,7 +51,7 @@ function mcp_post_details($id, $mode, $action) if ($auth->acl_get('m_info', $post_info['forum_id'])) { - $ip = request_var('ip', ''); + $ip = $request->variable('ip', ''); include($phpbb_root_path . 'includes/functions_user.' . $phpEx); $template->assign_vars(array( @@ -72,12 +72,12 @@ function mcp_post_details($id, $mode, $action) if ($action == 'chgposter') { - $username = request_var('username', '', true); + $username = $request->variable('username', '', true); $sql_where = "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; } else { - $new_user_id = request_var('u', 0); + $new_user_id = $request->variable('u', 0); $sql_where = 'user_id = ' . $new_user_id; } @@ -244,7 +244,7 @@ function mcp_post_details($id, $mode, $action) 'POST_SUBJECT' => $post_info['post_subject'], 'POST_DATE' => $user->format_date($post_info['post_time']), 'POST_IP' => $post_info['poster_ip'], - 'POST_IPADDR' => ($auth->acl_get('m_info', $post_info['forum_id']) && request_var('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '', + 'POST_IPADDR' => ($auth->acl_get('m_info', $post_info['forum_id']) && $request->variable('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '', 'POST_ID' => $post_info['post_id'], 'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? "$url&i=$id&mode=$mode&lookup={$post_info['poster_ip']}#ip" : '', @@ -314,7 +314,7 @@ function mcp_post_details($id, $mode, $action) // Get IP if ($auth->acl_get('m_info', $post_info['forum_id'])) { - $rdns_ip_num = request_var('rdns', ''); + $rdns_ip_num = $request->variable('rdns', ''); if ($rdns_ip_num != 'all') { diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 96a795f043..84db205fec 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -41,8 +41,8 @@ class mcp_queue include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); - $forum_id = request_var('f', 0); - $start = request_var('start', 0); + $forum_id = $request->variable('f', 0); + $start = $request->variable('start', 0); $this->page_title = 'MCP_QUEUE'; @@ -153,8 +153,8 @@ class mcp_queue $user->add_lang(array('posting', 'viewtopic')); - $post_id = request_var('p', 0); - $topic_id = request_var('t', 0); + $post_id = $request->variable('p', 0); + $topic_id = $request->variable('t', 0); /* @var $phpbb_notifications \phpbb\notification\manager */ $phpbb_notifications = $phpbb_container->get('notification_manager'); @@ -319,7 +319,7 @@ class mcp_queue 'POST_SUBJECT' => $post_info['post_subject'], 'POST_DATE' => $user->format_date($post_info['post_time']), 'POST_IP' => $post_info['poster_ip'], - 'POST_IPADDR' => ($auth->acl_get('m_info', $post_info['forum_id']) && request_var('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '', + 'POST_IPADDR' => ($auth->acl_get('m_info', $post_info['forum_id']) && $request->variable('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '', 'POST_ID' => $post_info['post_id'], 'S_FIRST_POST' => ($post_info['topic_first_post_id'] == $post_id), diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index b54703bd9f..bcfbd25c0f 100644 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -35,13 +35,13 @@ class mcp_reports function main($id, $mode) { - global $auth, $db, $user, $template, $cache; + global $auth, $db, $user, $template, $cache, $request; global $config, $phpbb_root_path, $phpEx, $action, $phpbb_container, $phpbb_dispatcher; include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); - $forum_id = request_var('f', 0); - $start = request_var('start', 0); + $forum_id = $request->variable('f', 0); + $start = $request->variable('start', 0); $this->page_title = 'MCP_REPORTS'; @@ -51,7 +51,7 @@ class mcp_reports case 'delete': include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); - $report_id_list = request_var('report_id_list', array(0)); + $report_id_list = $request->variable('report_id_list', array(0)); if (!sizeof($report_id_list)) { @@ -69,10 +69,10 @@ class mcp_reports $user->add_lang(array('posting', 'viewforum', 'viewtopic')); - $post_id = request_var('p', 0); + $post_id = $request->variable('p', 0); // closed reports are accessed by report id - $report_id = request_var('r', 0); + $report_id = $request->variable('r', 0); $sql = 'SELECT r.post_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, r.reported_post_text, r.reported_post_uid, r.reported_post_bitfield, r.reported_post_enable_magic_url, r.reported_post_enable_smilies, r.reported_post_enable_bbcode, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour FROM ' . REPORTS_TABLE . ' r, ' . REPORTS_REASONS_TABLE . ' rr, ' . USERS_TABLE . ' u @@ -240,7 +240,7 @@ class mcp_reports 'POST_SUBJECT' => ($post_info['post_subject']) ? $post_info['post_subject'] : $user->lang['NO_SUBJECT'], 'POST_DATE' => $user->format_date($post_info['post_time']), 'POST_IP' => $post_info['poster_ip'], - 'POST_IPADDR' => ($auth->acl_get('m_info', $post_info['forum_id']) && request_var('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '', + 'POST_IPADDR' => ($auth->acl_get('m_info', $post_info['forum_id']) && $request->variable('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '', 'POST_ID' => $post_info['post_id'], 'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? $this->u_action . '&r=' . $report_id . '&p=' . $post_id . '&f=' . $forum_id . '&lookup=' . $post_info['poster_ip'] . '#ip' : '', @@ -252,7 +252,7 @@ class mcp_reports case 'reports': case 'reports_closed': - $topic_id = request_var('t', 0); + $topic_id = $request->variable('t', 0); $forum_info = array(); $forum_list_reports = get_forum_list('m_report', false, true); @@ -473,7 +473,7 @@ class mcp_reports */ function close_report($report_id_list, $mode, $action, $pm = false) { - global $db, $template, $user, $config, $auth, $phpbb_log; + global $db, $template, $user, $config, $auth, $phpbb_log, $request; global $phpEx, $phpbb_root_path, $phpbb_container; $pm_where = ($pm) ? ' AND r.post_id = 0 ' : ' AND r.pm_id = 0 '; @@ -510,19 +510,19 @@ function close_report($report_id_list, $mode, $action, $pm = false) if ($action == 'delete' && strpos($user->data['session_page'], 'mode=report_details') !== false) { - $redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&mode=reports'); + $redirect = $request->variable('redirect', build_url(array('mode', 'r', 'quickmod')) . '&mode=reports'); } else if ($action == 'delete' && strpos($user->data['session_page'], 'mode=pm_report_details') !== false) { - $redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&mode=pm_reports'); + $redirect = $request->variable('redirect', build_url(array('mode', 'r', 'quickmod')) . '&mode=pm_reports'); } - else if ($action == 'close' && !request_var('r', 0)) + else if ($action == 'close' && !$request->variable('r', 0)) { - $redirect = request_var('redirect', build_url(array('mode', 'p', 'quickmod')) . '&mode=' . $module); + $redirect = $request->variable('redirect', build_url(array('mode', 'p', 'quickmod')) . '&mode=' . $module); } else { - $redirect = request_var('redirect', build_url(array('quickmod'))); + $redirect = $request->variable('redirect', build_url(array('quickmod'))); } $success_msg = ''; $forum_ids = array(); @@ -720,7 +720,7 @@ function close_report($report_id_list, $mode, $action, $pm = false) confirm_box(false, $user->lang[strtoupper($action) . "_{$pm_prefix}REPORT" . ((sizeof($report_id_list) == 1) ? '' : 'S') . '_CONFIRM'], $s_hidden_fields); } - $redirect = request_var('redirect', "index.$phpEx"); + $redirect = $request->variable('redirect', "index.$phpEx"); $redirect = reapply_sid($redirect); if (!$success_msg) diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 2d4131626f..03f61de051 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -24,7 +24,7 @@ if (!defined('IN_PHPBB')) */ function mcp_topic_view($id, $mode, $action) { - global $phpEx, $phpbb_root_path, $config; + global $phpEx, $phpbb_root_path, $config, $request; global $template, $db, $user, $auth, $cache, $phpbb_container, $phpbb_dispatcher; $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . phpbb_extra_url()); @@ -33,7 +33,7 @@ function mcp_topic_view($id, $mode, $action) $pagination = $phpbb_container->get('pagination'); $user->add_lang('viewtopic'); - $topic_id = request_var('t', 0); + $topic_id = $request->variable('t', 0); $topic_info = phpbb_get_topic_data(array($topic_id), false, true); if (!sizeof($topic_info)) @@ -44,16 +44,16 @@ function mcp_topic_view($id, $mode, $action) $topic_info = $topic_info[$topic_id]; // Set up some vars - $icon_id = request_var('icon', 0); - $subject = utf8_normalize_nfc(request_var('subject', '', true)); - $start = request_var('start', 0); - $sort_days_old = request_var('st_old', 0); - $forum_id = request_var('f', 0); - $to_topic_id = request_var('to_topic_id', 0); - $to_forum_id = request_var('to_forum_id', 0); + $icon_id = $request->variable('icon', 0); + $subject = utf8_normalize_nfc($request->variable('subject', '', true)); + $start = $request->variable('start', 0); + $sort_days_old = $request->variable('st_old', 0); + $forum_id = $request->variable('f', 0); + $to_topic_id = $request->variable('to_topic_id', 0); + $to_forum_id = $request->variable('to_forum_id', 0); $sort = isset($_POST['sort']) ? true : false; - $submitted_id_list = request_var('post_ids', array(0)); - $checked_ids = $post_id_list = request_var('post_id_list', array(0)); + $submitted_id_list = $request->variable('post_ids', array(0)); + $checked_ids = $post_id_list = $request->variable('post_id_list', array(0)); // Resync Topic? if ($action == 'resync') @@ -126,7 +126,7 @@ function mcp_topic_view($id, $mode, $action) $total = $phpbb_content_visibility->get_count('topic_posts', $topic_info, $topic_info['forum_id']); } - $posts_per_page = max(0, request_var('posts_per_page', intval($config['posts_per_page']))); + $posts_per_page = max(0, $request->variable('posts_per_page', intval($config['posts_per_page']))); if ($posts_per_page == 0) { $posts_per_page = $total; @@ -388,11 +388,11 @@ function mcp_topic_view($id, $mode, $action) */ function split_topic($action, $topic_id, $to_forum_id, $subject) { - global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $config, $phpbb_log; + global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $config, $phpbb_log, $request; - $post_id_list = request_var('post_id_list', array(0)); - $forum_id = request_var('forum_id', 0); - $start = request_var('start', 0); + $post_id_list = $request->variable('post_id_list', array(0)); + $forum_id = $request->variable('forum_id', 0); + $start = $request->variable('start', 0); if (!sizeof($post_id_list)) { @@ -446,7 +446,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) return; } - $redirect = request_var('redirect', build_url(array('quickmod'))); + $redirect = $request->variable('redirect', build_url(array('quickmod'))); $s_hidden_fields = build_hidden_fields(array( 'i' => 'main', @@ -459,7 +459,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) 'redirect' => $redirect, 'subject' => $subject, 'to_forum_id' => $to_forum_id, - 'icon' => request_var('icon', 0)) + 'icon' => $request->variable('icon', 0)) ); $success_msg = $return_link = ''; @@ -522,7 +522,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) trigger_error('NO_POST_SELECTED'); } - $icon_id = request_var('icon', 0); + $icon_id = $request->variable('icon', 0); $sql_ary = array( 'forum_id' => $to_forum_id, @@ -607,7 +607,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) // Link back to both topics $return_link = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&t=' . $post_info['topic_id']) . '">', '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&t=' . $to_topic_id) . '">', '</a>'); - $redirect = request_var('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&t=$to_topic_id"); + $redirect = $request->variable('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&t=$to_topic_id"); $redirect = reapply_sid($redirect); meta_refresh(3, $redirect); @@ -624,7 +624,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; + global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $phpbb_log, $request; if (!$to_topic_id) { @@ -650,8 +650,8 @@ function merge_posts($topic_id, $to_topic_id) $topic_data = $topic_data[$to_topic_id]; - $post_id_list = request_var('post_id_list', array(0)); - $start = request_var('start', 0); + $post_id_list = $request->variable('post_id_list', array(0)); + $start = $request->variable('start', 0); if (!sizeof($post_id_list)) { @@ -664,7 +664,7 @@ function merge_posts($topic_id, $to_topic_id) return; } - $redirect = request_var('redirect', build_url(array('quickmod'))); + $redirect = $request->variable('redirect', build_url(array('quickmod'))); $s_hidden_fields = build_hidden_fields(array( 'i' => 'main', @@ -727,7 +727,7 @@ function merge_posts($topic_id, $to_topic_id) // Link to the new topic $return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&t=' . $to_topic_id) . '">', '</a>'); - $redirect = request_var('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&t=$to_topic_id"); + $redirect = $request->variable('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&t=$to_topic_id"); $redirect = reapply_sid($redirect); meta_refresh(3, $redirect); diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index 85101da5ec..4a3a8b4c2f 100644 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -35,10 +35,10 @@ class mcp_warn function main($id, $mode) { - global $auth, $db, $user, $template; + global $auth, $db, $user, $template, $request; global $config, $phpbb_root_path, $phpEx; - $action = request_var('action', array('' => '')); + $action = $request->variable('action', array('' => '')); if (is_array($action)) { @@ -132,16 +132,16 @@ class mcp_warn function mcp_warn_list_view($action) { global $phpEx, $phpbb_root_path, $config, $phpbb_container; - global $template, $db, $user, $auth; + global $template, $db, $user, $auth, $request; /* @var $pagination \phpbb\pagination */ $pagination = $phpbb_container->get('pagination'); $user->add_lang('memberlist'); - $start = request_var('start', 0); - $st = request_var('st', 0); - $sk = request_var('sk', 'b'); - $sd = request_var('sd', 'd'); + $start = $request->variable('start', 0); + $st = $request->variable('st', 0); + $sk = $request->variable('sk', 'b'); + $sd = $request->variable('sd', 'd'); $limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']); $sort_by_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_DATE'], 'c' => $user->lang['SORT_WARNINGS']); @@ -190,13 +190,13 @@ class mcp_warn */ function mcp_warn_post_view($action) { - global $phpEx, $phpbb_root_path, $config; + global $phpEx, $phpbb_root_path, $config, $request; global $template, $db, $user, $auth, $phpbb_dispatcher; - $post_id = request_var('p', 0); - $forum_id = request_var('f', 0); + $post_id = $request->variable('p', 0); + $forum_id = $request->variable('f', 0); $notify = (isset($_REQUEST['notify_user'])) ? true : false; - $warning = utf8_normalize_nfc(request_var('warning', '', true)); + $warning = utf8_normalize_nfc($request->variable('warning', '', true)); $sql = 'SELECT u.*, p.* FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u @@ -370,13 +370,13 @@ class mcp_warn */ function mcp_warn_user_view($action) { - global $phpEx, $phpbb_root_path, $config, $module; + global $phpEx, $phpbb_root_path, $config, $module, $request; global $template, $db, $user, $auth, $phpbb_dispatcher; - $user_id = request_var('u', 0); - $username = request_var('username', '', true); + $user_id = $request->variable('u', 0); + $username = $request->variable('username', '', true); $notify = (isset($_REQUEST['notify_user'])) ? true : false; - $warning = utf8_normalize_nfc(request_var('warning', '', true)); + $warning = utf8_normalize_nfc($request->variable('warning', '', true)); $sql_where = ($user_id) ? "user_id = $user_id" : "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 04a2726d22..76c69cfc6a 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -1475,7 +1475,7 @@ class parse_message extends bbcode_firstpass $error = array(); $num_attachments = sizeof($this->attachment_data); - $this->filename_data['filecomment'] = utf8_normalize_nfc(request_var('filecomment', '', true)); + $this->filename_data['filecomment'] = utf8_normalize_nfc($request->variable('filecomment', '', true)); $upload = $request->file($form_name); $upload_file = (!empty($upload) && $upload['name'] !== 'none' && trim($upload['name'])); @@ -1483,7 +1483,7 @@ class parse_message extends bbcode_firstpass $delete_file = (isset($_POST['delete_file'])) ? true : false; // First of all adjust comments if changed - $actual_comment_list = utf8_normalize_nfc(request_var('comment_list', array(''), true)); + $actual_comment_list = utf8_normalize_nfc($request->variable('comment_list', array(''), true)); foreach ($actual_comment_list as $comment_key => $comment) { @@ -1569,7 +1569,7 @@ class parse_message extends bbcode_firstpass { include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx); - $index = array_keys(request_var('delete_file', array(0 => 0))); + $index = array_keys($request->variable('delete_file', array(0 => 0))); $index = (!empty($index)) ? $index[0] : false; if ($index !== false && !empty($this->attachment_data[$index])) @@ -1695,7 +1695,7 @@ class parse_message extends bbcode_firstpass global $user, $db, $phpbb_root_path, $phpEx, $config; global $request; - $this->filename_data['filecomment'] = utf8_normalize_nfc(request_var('filecomment', '', true)); + $this->filename_data['filecomment'] = utf8_normalize_nfc($request->variable('filecomment', '', true)); $attachment_data = $request->variable('attachment_data', array(0 => array('' => '')), true, \phpbb\request\request_interface::POST); $this->attachment_data = array(); diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php index 4ee9447f00..f535073434 100644 --- a/phpBB/includes/ucp/ucp_activate.php +++ b/phpBB/includes/ucp/ucp_activate.php @@ -29,11 +29,11 @@ class ucp_activate function main($id, $mode) { - global $config, $phpbb_root_path, $phpEx; + global $config, $phpbb_root_path, $phpEx, $request; global $db, $user, $auth, $template, $phpbb_container, $phpbb_log; - $user_id = request_var('u', 0); - $key = request_var('k', ''); + $user_id = $request->variable('u', 0); + $key = $request->variable('k', ''); $sql = 'SELECT user_id, username, user_type, user_email, user_newpasswd, user_lang, user_notify_type, user_actkey, user_inactive_reason FROM ' . USERS_TABLE . " diff --git a/phpBB/includes/ucp/ucp_attachments.php b/phpBB/includes/ucp/ucp_attachments.php index 1b17425c1f..639f308091 100644 --- a/phpBB/includes/ucp/ucp_attachments.php +++ b/phpBB/includes/ucp/ucp_attachments.php @@ -29,15 +29,15 @@ class ucp_attachments function main($id, $mode) { - global $template, $user, $db, $config, $phpEx, $phpbb_root_path, $phpbb_container; + global $template, $user, $db, $config, $phpEx, $phpbb_root_path, $phpbb_container, $request; - $start = request_var('start', 0); - $sort_key = request_var('sk', 'a'); - $sort_dir = request_var('sd', 'a'); + $start = $request->variable('start', 0); + $sort_key = $request->variable('sk', 'a'); + $sort_dir = $request->variable('sd', 'a'); $delete = (isset($_POST['delete'])) ? true : false; $confirm = (isset($_POST['confirm'])) ? true : false; - $delete_ids = array_keys(request_var('attachment', array(0))); + $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 7392f8dea8..403f7d37d0 100644 --- a/phpBB/includes/ucp/ucp_confirm.php +++ b/phpBB/includes/ucp/ucp_confirm.php @@ -36,10 +36,10 @@ class ucp_confirm function main($id, $mode) { - global $db, $user, $phpbb_root_path, $config, $phpEx, $phpbb_container; + global $db, $user, $phpbb_root_path, $config, $phpEx, $phpbb_container, $request; $captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']); - $captcha->init(request_var('type', 0)); + $captcha->init($request->variable('type', 0)); $captcha->execute(); garbage_collection(); diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index a33828b1cf..01525fb5f5 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -36,7 +36,7 @@ class ucp_groups $return_page = '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '">', '</a>'); - $mark_ary = request_var('mark', array(0)); + $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(); @@ -49,8 +49,8 @@ class ucp_groups if ($submit || isset($_POST['change_default'])) { - $action = (isset($_POST['change_default'])) ? 'change_default' : request_var('action', ''); - $group_id = ($action == 'change_default') ? request_var('default', 0) : request_var('selected', 0); + $action = (isset($_POST['change_default'])) ? 'change_default' : $request->variable('action', ''); + $group_id = ($action == 'change_default') ? $request->variable('default', 0) : $request->variable('selected', 0); if (!$group_id) { @@ -391,8 +391,8 @@ class ucp_groups case 'manage': $this->page_title = 'UCP_USERGROUPS_MANAGE'; - $action = (isset($_POST['addusers'])) ? 'addusers' : request_var('action', ''); - $group_id = request_var('g', 0); + $action = (isset($_POST['addusers'])) ? 'addusers' : $request->variable('action', ''); + $group_id = $request->variable('g', 0); include($phpbb_root_path . 'includes/functions_display.' . $phpEx); @@ -510,20 +510,20 @@ class ucp_groups // Did we submit? if ($update) { - $group_name = utf8_normalize_nfc(request_var('group_name', '', true)); - $group_desc = utf8_normalize_nfc(request_var('group_desc', '', true)); - $group_type = request_var('group_type', GROUP_FREE); + $group_name = utf8_normalize_nfc($request->variable('group_name', '', true)); + $group_desc = utf8_normalize_nfc($request->variable('group_desc', '', true)); + $group_type = $request->variable('group_type', GROUP_FREE); - $allow_desc_bbcode = request_var('desc_parse_bbcode', false); - $allow_desc_urls = request_var('desc_parse_urls', false); - $allow_desc_smilies = request_var('desc_parse_smilies', false); + $allow_desc_bbcode = $request->variable('desc_parse_bbcode', false); + $allow_desc_urls = $request->variable('desc_parse_urls', false); + $allow_desc_smilies = $request->variable('desc_parse_smilies', false); $submit_ary = array( - 'colour' => request_var('group_colour', ''), - 'rank' => request_var('group_rank', 0), + 'colour' => $request->variable('group_colour', ''), + 'rank' => $request->variable('group_rank', 0), 'receive_pm' => isset($_REQUEST['group_receive_pm']) ? 1 : 0, - 'message_limit' => request_var('group_message_limit', 0), - 'max_recipients'=> request_var('group_max_recipients', 0), + 'message_limit' => $request->variable('group_message_limit', 0), + 'max_recipients'=> $request->variable('group_max_recipients', 0), 'legend' => $group_row['group_legend'], 'teampage' => $group_row['group_teampage'], ); @@ -621,7 +621,7 @@ class ucp_groups } else if (!$group_id) { - $group_name = utf8_normalize_nfc(request_var('group_name', '', true)); + $group_name = utf8_normalize_nfc($request->variable('group_name', '', true)); $group_desc_data = array( 'text' => '', 'allow_bbcode' => true, @@ -750,7 +750,7 @@ class ucp_groups } $user->add_lang(array('acp/groups', 'acp/common')); - $start = request_var('start', 0); + $start = $request->variable('start', 0); // Grab the leaders - always, on every page... $sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_colour, u.user_regdate, u.user_posts, u.group_id, ug.group_leader, ug.user_pending @@ -1018,7 +1018,7 @@ class ucp_groups $user->add_lang(array('acp/groups', 'acp/common')); - $names = utf8_normalize_nfc(request_var('usernames', '', true)); + $names = utf8_normalize_nfc($request->variable('usernames', '', true)); if (!$group_id) { @@ -1044,7 +1044,7 @@ class ucp_groups $name_ary = array_unique(explode("\n", $names)); $group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name']; - $default = request_var('default', 0); + $default = $request->variable('default', 0); if (confirm_box(true)) { diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index b49f4d2ea0..2d76be6d62 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -219,8 +219,8 @@ class ucp_main { if (check_form_key('ucp_front_subscribed')) { - $forums = array_keys(request_var('f', array(0 => 0))); - $topics = array_keys(request_var('t', array(0 => 0))); + $forums = array_keys($request->variable('f', array(0 => 0))); + $topics = array_keys($request->variable('t', array(0 => 0))); $msg = ''; if (sizeof($forums) || sizeof($topics)) @@ -401,7 +401,7 @@ class ucp_main if (isset($_POST['unbookmark'])) { $s_hidden_fields = array('unbookmark' => 1); - $topics = (isset($_POST['t'])) ? array_keys(request_var('t', array(0 => 0))) : array(); + $topics = (isset($_POST['t'])) ? array_keys($request->variable('t', array(0 => 0))) : array(); $url = $this->u_action; if (!sizeof($topics)) @@ -457,7 +457,7 @@ class ucp_main { if (check_form_key('ucp_draft')) { - $drafts = array_keys(request_var('d', array(0 => 0))); + $drafts = array_keys($request->variable('d', array(0 => 0))); if (sizeof($drafts)) { @@ -480,8 +480,8 @@ class ucp_main if ($submit && $edit) { - $draft_subject = utf8_normalize_nfc(request_var('subject', '', true)); - $draft_message = utf8_normalize_nfc(request_var('message', '', true)); + $draft_subject = utf8_normalize_nfc($request->variable('subject', '', true)); + $draft_message = utf8_normalize_nfc($request->variable('message', '', true)); if (check_form_key('ucp_draft')) { if ($draft_message && $draft_subject) @@ -643,12 +643,12 @@ class ucp_main */ function assign_topiclist($mode = 'subscribed', $forbidden_forum_ary = array()) { - global $user, $db, $template, $config, $cache, $auth, $phpbb_root_path, $phpEx, $phpbb_container; + global $user, $db, $template, $config, $cache, $auth, $phpbb_root_path, $phpEx, $phpbb_container, $request; /* @var $pagination \phpbb\pagination */ $pagination = $phpbb_container->get('pagination'); $table = ($mode == 'subscribed') ? TOPICS_WATCH_TABLE : BOOKMARKS_TABLE; - $start = request_var('start', 0); + $start = $request->variable('start', 0); // Grab icons $icons = $cache->obtain_icons(); diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php index 425a56cf6c..5f24d05c8b 100644 --- a/phpBB/includes/ucp/ucp_pm.php +++ b/phpBB/includes/ucp/ucp_pm.php @@ -62,7 +62,7 @@ class ucp_pm $template->assign_var('S_PRIVMSGS', true); // Folder directly specified? - $folder_specified = request_var('folder', ''); + $folder_specified = $request->variable('folder', ''); if (!in_array($folder_specified, array('inbox', 'outbox', 'sentbox'))) { @@ -75,7 +75,7 @@ class ucp_pm if (!$folder_specified) { - $mode = (!$mode) ? request_var('mode', 'view') : $mode; + $mode = (!$mode) ? $request->variable('mode', 'view') : $mode; } else { @@ -88,7 +88,7 @@ class ucp_pm { // Compose message case 'compose': - $action = request_var('action', 'post'); + $action = $request->variable('action', 'post'); $user_folders = get_folder($user->data['user_id']); @@ -151,12 +151,12 @@ class ucp_pm } else { - $folder_id = request_var('f', PRIVMSGS_NO_BOX); - $action = request_var('action', 'view_folder'); + $folder_id = $request->variable('f', PRIVMSGS_NO_BOX); + $action = $request->variable('action', 'view_folder'); } - $msg_id = request_var('p', 0); - $view = request_var('view', ''); + $msg_id = $request->variable('p', 0); + $view = $request->variable('view', ''); // View message if specified if ($msg_id) @@ -178,8 +178,8 @@ class ucp_pm // First Handle Mark actions and moving messages $submit_mark = (isset($_POST['submit_mark'])) ? true : false; $move_pm = (isset($_POST['move_pm'])) ? true : false; - $mark_option = request_var('mark_option', ''); - $dest_folder = request_var('dest_folder', PRIVMSGS_NO_BOX); + $mark_option = $request->variable('mark_option', ''); + $dest_folder = $request->variable('dest_folder', PRIVMSGS_NO_BOX); // Is moving PM triggered through mark options? if (!in_array($mark_option, array('mark_important', 'delete_marked')) && $submit_mark) @@ -192,8 +192,8 @@ class ucp_pm // Move PM if ($move_pm) { - $move_msg_ids = (isset($_POST['marked_msg_id'])) ? request_var('marked_msg_id', array(0)) : array(); - $cur_folder_id = request_var('cur_folder_id', PRIVMSGS_NO_BOX); + $move_msg_ids = (isset($_POST['marked_msg_id'])) ? $request->variable('marked_msg_id', array(0)) : array(); + $cur_folder_id = $request->variable('cur_folder_id', PRIVMSGS_NO_BOX); if (move_pm($user->data['user_id'], $user->data['message_limit'], $move_msg_ids, $dest_folder, $cur_folder_id)) { @@ -201,7 +201,7 @@ class ucp_pm if ($action == 'view_message') { $msg_id = 0; - $folder_id = request_var('cur_folder_id', PRIVMSGS_NO_BOX); + $folder_id = $request->variable('cur_folder_id', PRIVMSGS_NO_BOX); $action = 'view_folder'; } } @@ -215,7 +215,7 @@ class ucp_pm // If new messages arrived, place them into the appropriate folder $num_not_moved = $num_removed = 0; - $release = request_var('release', 0); + $release = $request->variable('release', 0); if ($user->data['user_new_privmsg'] && ($action == 'view_folder' || $action == 'view_message')) { diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index fabcb54170..5bfc0ff706 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -44,14 +44,14 @@ function compose_pm($id, $mode, $action, $user_folders = array()) add_form_key('ucp_pm_compose'); // Grab only parameters needed here - $to_user_id = request_var('u', 0); - $to_group_id = request_var('g', 0); - $msg_id = request_var('p', 0); - $draft_id = request_var('d', 0); - $lastclick = request_var('lastclick', 0); + $to_user_id = $request->variable('u', 0); + $to_group_id = $request->variable('g', 0); + $msg_id = $request->variable('p', 0); + $draft_id = $request->variable('d', 0); + $lastclick = $request->variable('lastclick', 0); // Reply to all triggered (quote/reply) - $reply_to_all = request_var('reply_to_all', 0); + $reply_to_all = $request->variable('reply_to_all', 0); $address_list = $request->variable('address_list', array('' => array(0 => ''))); @@ -620,9 +620,9 @@ function compose_pm($id, $mode, $action, $user_folders = array()) // Save Draft if ($save && $auth->acl_get('u_savedrafts')) { - $subject = utf8_normalize_nfc(request_var('subject', '', true)); + $subject = utf8_normalize_nfc($request->variable('subject', '', true)); $subject = (!$subject && $action != 'post') ? $user->lang['NEW_MESSAGE'] : $subject; - $message = utf8_normalize_nfc(request_var('message', '', true)); + $message = utf8_normalize_nfc($request->variable('message', '', true)); if ($subject && $message) { @@ -716,10 +716,10 @@ function compose_pm($id, $mode, $action, $user_folders = array()) { $error[] = $user->lang['FORM_INVALID']; } - $subject = utf8_normalize_nfc(request_var('subject', '', true)); - $message_parser->message = utf8_normalize_nfc(request_var('message', '', true)); + $subject = utf8_normalize_nfc($request->variable('subject', '', true)); + $message_parser->message = utf8_normalize_nfc($request->variable('message', '', true)); - $icon_id = request_var('icon', 0); + $icon_id = $request->variable('icon', 0); $enable_bbcode = (!$bbcode_status || isset($_POST['disable_bbcode'])) ? false : true; $enable_smilies = (!$smilies_status || isset($_POST['disable_smilies'])) ? false : true; @@ -907,7 +907,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) { if ($action == 'quotepost') { - $post_id = request_var('p', 0); + $post_id = $request->variable('p', 0); if ($config['allow_post_links']) { $message_link = "[url=" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id}]{$user->lang['SUBJECT']}{$user->lang['COLON']} {$message_subject}[/url]\n\n"; @@ -1224,13 +1224,13 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove } // Add Selected Groups - $group_list = request_var('group_list', array(0)); + $group_list = $request->variable('group_list', array(0)); // Build usernames to add - $usernames = request_var('username', '', true); + $usernames = $request->variable('username', '', true); $usernames = (empty($usernames)) ? array() : array($usernames); - $username_list = request_var('username_list', '', true); + $username_list = $request->variable('username_list', '', true); if ($username_list) { $usernames = array_merge($usernames, explode("\n", $username_list)); @@ -1247,7 +1247,7 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove $submit = false; // Preview is only true if there was also a message entered - if (request_var('message', '')) + if ($request->variable('message', '')) { $preview = true; } diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php index d1fc9d2c62..3ea2973439 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; + global $phpbb_root_path, $phpEx, $user, $template, $auth, $config, $db, $request; $redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=options"); @@ -37,7 +37,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit trigger_error('FORM_INVALID'); } - $full_action = request_var('full_action', 0); + $full_action = $request->variable('full_action', 0); $set_folder_id = 0; switch ($full_action) @@ -47,7 +47,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit break; case 2: - $set_folder_id = request_var('full_move_to', PRIVMSGS_INBOX); + $set_folder_id = $request->variable('full_move_to', PRIVMSGS_INBOX); break; case 3: @@ -79,7 +79,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit { if (check_form_key('ucp_pm_options')) { - $folder_name = utf8_normalize_nfc(request_var('foldername', '', true)); + $folder_name = utf8_normalize_nfc($request->variable('foldername', '', true)); $msg = ''; if ($folder_name) @@ -135,8 +135,8 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit { if (check_form_key('ucp_pm_options')) { - $new_folder_name = utf8_normalize_nfc(request_var('new_folder_name', '', true)); - $rename_folder_id= request_var('rename_folder_id', 0); + $new_folder_name = utf8_normalize_nfc($request->variable('new_folder_name', '', true)); + $rename_folder_id= $request->variable('rename_folder_id', 0); if (!$new_folder_name) { @@ -178,11 +178,11 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit // Remove Folder if (isset($_POST['remove_folder'])) { - $remove_folder_id = request_var('remove_folder_id', 0); + $remove_folder_id = $request->variable('remove_folder_id', 0); // Default to "move all messages to inbox" - $remove_action = request_var('remove_action', 1); - $move_to = request_var('move_to', PRIVMSGS_INBOX); + $remove_action = $request->variable('remove_action', 1); + $move_to = $request->variable('move_to', PRIVMSGS_INBOX); // Move to same folder? if ($remove_action == 1 && $remove_folder_id == $move_to) @@ -291,13 +291,13 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit { if (check_form_key('ucp_pm_options')) { - $check_option = request_var('check_option', 0); - $rule_option = request_var('rule_option', 0); - $cond_option = request_var('cond_option', ''); - $action_option = explode('|', request_var('action_option', '')); - $rule_string = ($cond_option != 'none') ? utf8_normalize_nfc(request_var('rule_string', '', true)) : ''; - $rule_user_id = ($cond_option != 'none') ? request_var('rule_user_id', 0) : 0; - $rule_group_id = ($cond_option != 'none') ? request_var('rule_group_id', 0) : 0; + $check_option = $request->variable('check_option', 0); + $rule_option = $request->variable('rule_option', 0); + $cond_option = $request->variable('cond_option', ''); + $action_option = explode('|', $request->variable('action_option', '')); + $rule_string = ($cond_option != 'none') ? utf8_normalize_nfc($request->variable('rule_string', '', true)) : ''; + $rule_user_id = ($cond_option != 'none') ? $request->variable('rule_user_id', 0) : 0; + $rule_group_id = ($cond_option != 'none') ? $request->variable('rule_group_id', 0) : 0; $action = (int) $action_option[0]; $folder_id = (int) $action_option[1]; @@ -371,7 +371,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit // Remove Rule if (isset($_POST['delete_rule']) && !isset($_POST['cancel'])) { - $delete_id = array_keys(request_var('delete_rule', array(0 => 0))); + $delete_id = array_keys($request->variable('delete_rule', array(0 => 0))); $delete_id = (!empty($delete_id[0])) ? $delete_id[0] : 0; if (!$delete_id) @@ -514,11 +514,11 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit -> CHECK_* -> RULE_* [IN $global_privmsgs_rules:CHECK_*] -> [IF $rule_conditions[RULE_*] [|text|bool|user|group|own_group]] -> ACTION_* */ - $check_option = request_var('check_option', 0); - $rule_option = request_var('rule_option', 0); - $cond_option = request_var('cond_option', ''); - $action_option = request_var('action_option', ''); - $back = (isset($_REQUEST['back'])) ? request_var('back', array('' => 0)) : array(); + $check_option = $request->variable('check_option', 0); + $rule_option = $request->variable('rule_option', 0); + $cond_option = $request->variable('cond_option', ''); + $action_option = $request->variable('action_option', ''); + $back = (isset($_REQUEST['back'])) ? $request->variable('back', array('' => 0)) : array(); if (sizeof($back)) { @@ -698,7 +698,7 @@ function define_rule_option($hardcoded, $rule_option, $rule_lang, $check_ary) */ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule_conditions) { - global $db, $template, $auth, $user; + global $db, $template, $auth, $user, $request; $template->assign_vars(array( 'S_COND_DEFINED' => true, @@ -722,7 +722,7 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule switch ($condition) { case 'text': - $rule_string = utf8_normalize_nfc(request_var('rule_string', '', true)); + $rule_string = utf8_normalize_nfc($request->variable('rule_string', '', true)); $template->assign_vars(array( 'S_TEXT_CONDITION' => true, @@ -735,8 +735,8 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule break; case 'user': - $rule_user_id = request_var('rule_user_id', 0); - $rule_string = utf8_normalize_nfc(request_var('rule_string', '', true)); + $rule_user_id = $request->variable('rule_user_id', 0); + $rule_string = utf8_normalize_nfc($request->variable('rule_string', '', true)); if ($rule_string && !$rule_user_id) { @@ -778,8 +778,8 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule break; case 'group': - $rule_group_id = request_var('rule_group_id', 0); - $rule_string = utf8_normalize_nfc(request_var('rule_string', '', true)); + $rule_group_id = $request->variable('rule_group_id', 0); + $rule_string = utf8_normalize_nfc($request->variable('rule_string', '', true)); $sql = 'SELECT g.group_id, g.group_name, g.group_type FROM ' . GROUPS_TABLE . ' g '; diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php index 7b9b834ebe..e88e40a1cb 100644 --- a/phpBB/includes/ucp/ucp_pm_viewfolder.php +++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -25,7 +25,7 @@ if (!defined('IN_PHPBB')) */ function view_folder($id, $mode, $folder_id, $folder) { - global $user, $template, $auth, $db, $cache; + global $user, $template, $auth, $db, $cache, $request; global $phpbb_root_path, $config, $phpEx; $submit_export = (isset($_POST['submit_export'])) ? true : false; @@ -196,9 +196,9 @@ function view_folder($id, $mode, $folder_id, $folder) } else { - $export_type = request_var('export_option', ''); - $enclosure = request_var('enclosure', ''); - $delimiter = request_var('delimiter', ''); + $export_type = $request->variable('export_option', ''); + $enclosure = $request->variable('enclosure', ''); + $delimiter = $request->variable('delimiter', ''); if ($export_type == 'CSV' && ($delimiter === '' || $enclosure === '')) { @@ -397,14 +397,14 @@ function view_folder($id, $mode, $folder_id, $folder) */ function get_pm_from($folder_id, $folder, $user_id) { - global $user, $db, $template, $config, $auth, $phpbb_container, $phpbb_root_path, $phpEx; + global $user, $db, $template, $config, $auth, $phpbb_container, $phpbb_root_path, $phpEx, $request; - $start = request_var('start', 0); + $start = $request->variable('start', 0); // Additional vars later, pm ordering is mostly different from post ordering. :/ - $sort_days = request_var('st', 0); - $sort_key = request_var('sk', 't'); - $sort_dir = request_var('sd', 'd'); + $sort_days = $request->variable('st', 0); + $sort_key = $request->variable('sk', 't'); + $sort_dir = $request->variable('sd', 'd'); /* @var $pagination \phpbb\pagination */ $pagination = $phpbb_container->get('pagination'); diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 6fa80cb64d..b3220ef4d6 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -32,7 +32,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) $msg_id = (int) $msg_id; $folder_id = (int) $folder_id; $author_id = (int) $message_row['author_id']; - $view = request_var('view', ''); + $view = $request->variable('view', ''); // Not able to view message, it was deleted by the sender if ($message_row['pm_deleted']) diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index 1d3fb19f67..cbaa71c33e 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; + global $config, $db, $user, $auth, $template, $phpbb_dispatcher, $phpbb_root_path, $phpEx, $request; $submit = (isset($_POST['submit'])) ? true : false; $error = $data = array(); @@ -40,16 +40,16 @@ class ucp_prefs case 'personal': add_form_key('ucp_prefs_personal'); $data = array( - 'notifymethod' => request_var('notifymethod', $user->data['user_notify_type']), - 'dateformat' => request_var('dateformat', $user->data['user_dateformat'], true), - 'lang' => basename(request_var('lang', $user->data['user_lang'])), - 'user_style' => request_var('user_style', (int) $user->data['user_style']), - 'tz' => request_var('tz', $user->data['user_timezone']), - - 'viewemail' => request_var('viewemail', (bool) $user->data['user_allow_viewemail']), - 'massemail' => request_var('massemail', (bool) $user->data['user_allow_massemail']), - 'hideonline' => request_var('hideonline', (bool) !$user->data['user_allow_viewonline']), - 'allowpm' => request_var('allowpm', (bool) $user->data['user_allow_pm']), + 'notifymethod' => $request->variable('notifymethod', $user->data['user_notify_type']), + 'dateformat' => $request->variable('dateformat', $user->data['user_dateformat'], true), + 'lang' => basename($request->variable('lang', $user->data['user_lang'])), + 'user_style' => $request->variable('user_style', (int) $user->data['user_style']), + 'tz' => $request->variable('tz', $user->data['user_timezone']), + + 'viewemail' => $request->variable('viewemail', (bool) $user->data['user_allow_viewemail']), + 'massemail' => $request->variable('massemail', (bool) $user->data['user_allow_massemail']), + 'hideonline' => $request->variable('hideonline', (bool) !$user->data['user_allow_viewonline']), + 'allowpm' => $request->variable('allowpm', (bool) $user->data['user_allow_pm']), ); if ($data['notifymethod'] == NOTIFY_IM && (!$config['jab_enable'] || !$user->data['user_jabber'] || !@extension_loaded('xml'))) @@ -221,20 +221,20 @@ class ucp_prefs add_form_key('ucp_prefs_view'); $data = array( - 'topic_sk' => request_var('topic_sk', (!empty($user->data['user_topic_sortby_type'])) ? $user->data['user_topic_sortby_type'] : 't'), - 'topic_sd' => request_var('topic_sd', (!empty($user->data['user_topic_sortby_dir'])) ? $user->data['user_topic_sortby_dir'] : 'd'), - 'topic_st' => request_var('topic_st', (!empty($user->data['user_topic_show_days'])) ? (int) $user->data['user_topic_show_days'] : 0), - - 'post_sk' => request_var('post_sk', (!empty($user->data['user_post_sortby_type'])) ? $user->data['user_post_sortby_type'] : 't'), - 'post_sd' => request_var('post_sd', (!empty($user->data['user_post_sortby_dir'])) ? $user->data['user_post_sortby_dir'] : 'a'), - 'post_st' => request_var('post_st', (!empty($user->data['user_post_show_days'])) ? (int) $user->data['user_post_show_days'] : 0), - - 'images' => request_var('images', (bool) $user->optionget('viewimg')), - 'flash' => request_var('flash', (bool) $user->optionget('viewflash')), - 'smilies' => request_var('smilies', (bool) $user->optionget('viewsmilies')), - 'sigs' => request_var('sigs', (bool) $user->optionget('viewsigs')), - 'avatars' => request_var('avatars', (bool) $user->optionget('viewavatars')), - 'wordcensor' => request_var('wordcensor', (bool) $user->optionget('viewcensors')), + 'topic_sk' => $request->variable('topic_sk', (!empty($user->data['user_topic_sortby_type'])) ? $user->data['user_topic_sortby_type'] : 't'), + 'topic_sd' => $request->variable('topic_sd', (!empty($user->data['user_topic_sortby_dir'])) ? $user->data['user_topic_sortby_dir'] : 'd'), + 'topic_st' => $request->variable('topic_st', (!empty($user->data['user_topic_show_days'])) ? (int) $user->data['user_topic_show_days'] : 0), + + 'post_sk' => $request->variable('post_sk', (!empty($user->data['user_post_sortby_type'])) ? $user->data['user_post_sortby_type'] : 't'), + 'post_sd' => $request->variable('post_sd', (!empty($user->data['user_post_sortby_dir'])) ? $user->data['user_post_sortby_dir'] : 'a'), + 'post_st' => $request->variable('post_st', (!empty($user->data['user_post_show_days'])) ? (int) $user->data['user_post_show_days'] : 0), + + 'images' => $request->variable('images', (bool) $user->optionget('viewimg')), + 'flash' => $request->variable('flash', (bool) $user->optionget('viewflash')), + 'smilies' => $request->variable('smilies', (bool) $user->optionget('viewsmilies')), + 'sigs' => $request->variable('sigs', (bool) $user->optionget('viewsigs')), + 'avatars' => $request->variable('avatars', (bool) $user->optionget('viewavatars')), + 'wordcensor' => $request->variable('wordcensor', (bool) $user->optionget('viewcensors')), ); /** @@ -393,10 +393,10 @@ class ucp_prefs case 'post': $data = array( - 'bbcode' => request_var('bbcode', $user->optionget('bbcode')), - 'smilies' => request_var('smilies', $user->optionget('smilies')), - 'sig' => request_var('sig', $user->optionget('attachsig')), - 'notify' => request_var('notify', (bool) $user->data['user_notify']), + 'bbcode' => $request->variable('bbcode', $user->optionget('bbcode')), + 'smilies' => $request->variable('smilies', $user->optionget('smilies')), + 'sig' => $request->variable('sig', $user->optionget('attachsig')), + 'notify' => $request->variable('notify', (bool) $user->data['user_notify']), ); add_form_key('ucp_prefs_post'); diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 2783f9f328..391aaf1781 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -46,8 +46,8 @@ class ucp_profile case 'reg_details': $data = array( - 'username' => utf8_normalize_nfc(request_var('username', $user->data['username'], true)), - 'email' => strtolower(request_var('email', $user->data['user_email'])), + 'username' => utf8_normalize_nfc($request->variable('username', $user->data['username'], true)), + 'email' => strtolower($request->variable('email', $user->data['user_email'])), 'new_password' => $request->variable('new_password', '', true), 'cur_password' => $request->variable('cur_password', '', true), 'password_confirm' => $request->variable('password_confirm', '', true), @@ -302,7 +302,7 @@ class ucp_profile $cp_data = $cp_error = array(); $data = array( - 'jabber' => utf8_normalize_nfc(request_var('jabber', $user->data['user_jabber'], true)), + 'jabber' => utf8_normalize_nfc($request->variable('jabber', $user->data['user_jabber'], true)), ); if ($config['allow_birthdays']) @@ -314,9 +314,9 @@ class ucp_profile list($data['bday_day'], $data['bday_month'], $data['bday_year']) = explode('-', $user->data['user_birthday']); } - $data['bday_day'] = request_var('bday_day', $data['bday_day']); - $data['bday_month'] = request_var('bday_month', $data['bday_month']); - $data['bday_year'] = request_var('bday_year', $data['bday_year']); + $data['bday_day'] = $request->variable('bday_day', $data['bday_day']); + $data['bday_month'] = $request->variable('bday_month', $data['bday_month']); + $data['bday_year'] = $request->variable('bday_year', $data['bday_year']); $data['user_birthday'] = sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']); } @@ -697,7 +697,7 @@ class ucp_profile if ($submit) { - $keys = request_var('keys', array('')); + $keys = $request->variable('keys', array('')); if (!check_form_key('ucp_autologin_keys')) { diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 0ff3028e75..ae9d7e0fba 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -42,8 +42,8 @@ class ucp_register $coppa = $request->is_set('coppa') ? (int) $request->variable('coppa', false) : false; $agreed = $request->variable('agreed', false); $submit = $request->is_set_post('submit'); - $change_lang = request_var('change_lang', ''); - $user_lang = request_var('lang', $user->lang_name); + $change_lang = $request->variable('change_lang', ''); + $user_lang = $request->variable('lang', $user->lang_name); if ($agreed) { @@ -115,10 +115,10 @@ class ucp_register { // We do not include the password $s_hidden_fields = array_merge($s_hidden_fields, array( - 'username' => utf8_normalize_nfc(request_var('username', '', true)), - 'email' => strtolower(request_var('email', '')), + 'username' => utf8_normalize_nfc($request->variable('username', '', true)), + 'email' => strtolower($request->variable('email', '')), 'lang' => $user->lang_name, - 'tz' => request_var('tz', $config['board_timezone']), + 'tz' => $request->variable('tz', $config['board_timezone']), )); } @@ -192,12 +192,12 @@ class ucp_register $timezone = $config['board_timezone']; $data = array( - 'username' => utf8_normalize_nfc(request_var('username', '', true)), + 'username' => utf8_normalize_nfc($request->variable('username', '', true)), 'new_password' => $request->variable('new_password', '', true), 'password_confirm' => $request->variable('password_confirm', '', true), - 'email' => strtolower(request_var('email', '')), - 'lang' => basename(request_var('lang', $user->lang_name)), - 'tz' => request_var('tz', $timezone), + 'email' => strtolower($request->variable('email', '')), + 'lang' => basename($request->variable('lang', $user->lang_name)), + 'tz' => $request->variable('tz', $timezone), ); // Check and initialize some variables if needed diff --git a/phpBB/includes/ucp/ucp_remind.php b/phpBB/includes/ucp/ucp_remind.php index 8c96955b14..2342aa2137 100644 --- a/phpBB/includes/ucp/ucp_remind.php +++ b/phpBB/includes/ucp/ucp_remind.php @@ -29,7 +29,7 @@ class ucp_remind function main($id, $mode) { - global $config, $phpbb_root_path, $phpEx; + global $config, $phpbb_root_path, $phpEx, $request; global $db, $user, $auth, $template, $phpbb_container; if (!$config['allow_password_reset']) @@ -37,8 +37,8 @@ class ucp_remind trigger_error($user->lang('UCP_PASSWORD_RESET_DISABLED', '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>')); } - $username = request_var('username', '', true); - $email = strtolower(request_var('email', '')); + $username = $request->variable('username', '', true); + $email = strtolower($request->variable('email', '')); $submit = (isset($_POST['submit'])) ? true : false; if ($submit) diff --git a/phpBB/includes/ucp/ucp_resend.php b/phpBB/includes/ucp/ucp_resend.php index 9fe8850000..44c54100cd 100644 --- a/phpBB/includes/ucp/ucp_resend.php +++ b/phpBB/includes/ucp/ucp_resend.php @@ -30,10 +30,10 @@ class ucp_resend function main($id, $mode) { global $config, $phpbb_root_path, $phpEx; - global $db, $user, $auth, $template; + global $db, $user, $auth, $template, $request; - $username = request_var('username', '', true); - $email = strtolower(request_var('email', '')); + $username = $request->variable('username', '', true); + $email = strtolower($request->variable('email', '')); $submit = (isset($_POST['submit'])) ? true : false; add_form_key('ucp_resend'); diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php index dbf8cf31c1..d4e7e70247 100644 --- a/phpBB/includes/ucp/ucp_zebra.php +++ b/phpBB/includes/ucp/ucp_zebra.php @@ -44,7 +44,7 @@ class ucp_zebra foreach ($var_ary as $var => $default) { - $data[$var] = request_var($var, $default, true); + $data[$var] = $request->variable($var, $default, true); } if (!empty($data['add']) || sizeof($data['usernames'])) diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index bc8ea16338..ba6f0b3ba9 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -109,9 +109,6 @@ $db = $phpbb_container->get('dbal.conn'); /* @var $phpbb_log \phpbb\log\log_interface */ $phpbb_log = $phpbb_container->get('log'); -// make sure request_var uses this request instance -request_var('', 0, false, false, $request); // "dependency injection" for a function - // Grab global variables, re-cache if necessary /* @var $config \phpbb\config\config */ $config = $phpbb_container->get('config'); diff --git a/phpBB/install/index.php b/phpBB/install/index.php index 495f49ee49..1c9fdb351d 100644 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -149,9 +149,6 @@ $phpbb_dispatcher = $phpbb_container->get('dispatcher'); /* @var $request \phpbb\request\request_interface */ $request = $phpbb_container->get('request'); -// make sure request_var uses this request instance -request_var('', 0, false, false, $request); // "dependency injection" for a function - // Try and load an appropriate language if required $language = basename($request->variable('language', '')); diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index 9f6116ed12..47c05ef491 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -153,7 +153,7 @@ class install_convert extends module // Detect if there is already a conversion in progress at this point and offer to resume // It's quite possible that the user will get disconnected during a large conversion so they need to be able to resume it - $new_conversion = request_var('new_conv', 0); + $new_conversion = $request->variable('new_conv', 0); if ($new_conversion) { @@ -390,7 +390,7 @@ class install_convert extends module // We need to fill the config to let internal functions correctly work $config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE); - $convertor_tag = request_var('tag', ''); + $convertor_tag = $request->variable('tag', ''); if (empty($convertor_tag)) { @@ -415,15 +415,15 @@ class install_convert extends module $submit = (isset($_POST['submit'])) ? true : false; - $src_dbms = request_var('src_dbms', $convertor_data['dbms']); - $src_dbhost = request_var('src_dbhost', $convertor_data['dbhost']); - $src_dbport = request_var('src_dbport', $convertor_data['dbport']); - $src_dbuser = request_var('src_dbuser', $convertor_data['dbuser']); - $src_dbpasswd = request_var('src_dbpasswd', $convertor_data['dbpasswd']); - $src_dbname = request_var('src_dbname', $convertor_data['dbname']); - $src_table_prefix = request_var('src_table_prefix', $convertor_data['table_prefix']); - $forum_path = request_var('forum_path', $convertor_data['forum_path']); - $refresh = request_var('refresh', 1); + $src_dbms = $request->variable('src_dbms', $convertor_data['dbms']); + $src_dbhost = $request->variable('src_dbhost', $convertor_data['dbhost']); + $src_dbport = $request->variable('src_dbport', $convertor_data['dbport']); + $src_dbuser = $request->variable('src_dbuser', $convertor_data['dbuser']); + $src_dbpasswd = $request->variable('src_dbpasswd', $convertor_data['dbpasswd']); + $src_dbname = $request->variable('src_dbname', $convertor_data['dbname']); + $src_table_prefix = $request->variable('src_table_prefix', $convertor_data['table_prefix']); + $forum_path = $request->variable('forum_path', $convertor_data['forum_path']); + $refresh = $request->variable('refresh', 1); // Default URL of the old board // @todo Are we going to use this for attempting to convert URL references in posts, or should we remove it? @@ -804,10 +804,10 @@ class install_convert extends module include($phpbb_root_path . 'includes/message_parser.' . $phpEx); $message_parser = new parse_message(); - $jump = request_var('jump', 0); - $final_jump = request_var('final_jump', 0); - $sync_batch = request_var('sync_batch', -1); - $last_statement = request_var('last', 0); + $jump = $request->variable('jump', 0); + $final_jump = $request->variable('final_jump', 0); + $sync_batch = $request->variable('sync_batch', -1); + $last_statement = $request->variable('last', 0); // We are running sync... if ($sync_batch >= 0) @@ -828,9 +828,9 @@ class install_convert extends module return; } - $current_table = request_var('current_table', 0); + $current_table = $request->variable('current_table', 0); $old_current_table = min(-1, $current_table - 1); - $skip_rows = request_var('skip_rows', 0); + $skip_rows = $request->variable('skip_rows', 0); if (!$current_table && !$skip_rows) { diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 536b7142d5..c3d37d18ac 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -2078,36 +2078,38 @@ class install_install extends module */ function get_submitted_data() { + global $request; + return array( - 'language' => basename(request_var('language', '')), - 'dbms' => request_var('dbms', ''), - 'dbhost' => request_var('dbhost', '', true), - 'dbport' => request_var('dbport', ''), - 'dbuser' => request_var('dbuser', ''), - 'dbpasswd' => request_var('dbpasswd', '', true), - 'dbname' => request_var('dbname', ''), - 'table_prefix' => request_var('table_prefix', ''), - 'default_lang' => basename(request_var('default_lang', '')), - 'admin_name' => utf8_normalize_nfc(request_var('admin_name', '', true)), - 'admin_pass1' => request_var('admin_pass1', '', true), - 'admin_pass2' => request_var('admin_pass2', '', true), - 'board_email' => strtolower(request_var('board_email', '')), - 'img_imagick' => request_var('img_imagick', ''), - 'ftp_path' => request_var('ftp_path', ''), - 'ftp_user' => request_var('ftp_user', ''), - 'ftp_pass' => request_var('ftp_pass', ''), - 'email_enable' => request_var('email_enable', ''), - 'smtp_delivery' => request_var('smtp_delivery', ''), - 'smtp_host' => request_var('smtp_host', ''), - 'smtp_auth' => request_var('smtp_auth', ''), - 'smtp_user' => request_var('smtp_user', ''), - 'smtp_pass' => request_var('smtp_pass', ''), - 'cookie_secure' => request_var('cookie_secure', ''), - 'force_server_vars' => request_var('force_server_vars', ''), - 'server_protocol' => request_var('server_protocol', ''), - 'server_name' => request_var('server_name', ''), - 'server_port' => request_var('server_port', ''), - 'script_path' => request_var('script_path', ''), + 'language' => basename($request->variable('language', '')), + 'dbms' => $request->variable('dbms', ''), + 'dbhost' => $request->variable('dbhost', ''), + 'dbport' => $request->variable('dbport', ''), + 'dbuser' => $request->variable('dbuser', ''), + 'dbpasswd' => $request->variable('dbpasswd', '', true), + 'dbname' => $request->variable('dbname', ''), + 'table_prefix' => $request->variable('table_prefix', ''), + 'default_lang' => basename($request->variable('default_lang', '')), + 'admin_name' => utf8_normalize_nfc($request->variable('admin_name', '', true)), + 'admin_pass1' => $request->variable('admin_pass1', '', true), + 'admin_pass2' => $request->variable('admin_pass2', '', true), + 'board_email' => strtolower($request->variable('board_email', '')), + 'img_imagick' => $request->variable('img_imagick', ''), + 'ftp_path' => $request->variable('ftp_path', ''), + 'ftp_user' => $request->variable('ftp_user', ''), + 'ftp_pass' => $request->variable('ftp_pass', ''), + 'email_enable' => $request->variable('email_enable', ''), + 'smtp_delivery' => $request->variable('smtp_delivery', ''), + 'smtp_host' => $request->variable('smtp_host', ''), + 'smtp_auth' => $request->variable('smtp_auth', ''), + 'smtp_user' => $request->variable('smtp_user', ''), + 'smtp_pass' => $request->variable('smtp_pass', ''), + 'cookie_secure' => $request->variable('cookie_secure', ''), + 'force_server_vars' => $request->variable('force_server_vars', ''), + 'server_protocol' => $request->variable('server_protocol', ''), + 'server_name' => $request->variable('server_name', ''), + 'server_port' => $request->variable('server_port', ''), + 'script_path' => $request->variable('script_path', ''), ); } diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index cb00895a4b..0ec6897607 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -351,7 +351,7 @@ class install_update extends module $this->page_title = 'STAGE_FILE_CHECK'; // Now make sure our update list is correct if the admin refreshes - $action = request_var('action', ''); + $action = $request->variable('action', ''); // We are directly within an update. To make sure our update list is correct we check its status. $update_list = ($request->variable('check_again', false, false, \phpbb\request\request_interface::POST)) ? false : $cache->get('_update_list'); @@ -541,8 +541,8 @@ class install_update extends module $s_hidden_fields = ''; $params = array(); - $conflicts = request_var('conflict', array('' => 0)); - $modified = request_var('modified', array('' => 0)); + $conflicts = $request->variable('conflict', array('' => 0)); + $modified = $request->variable('modified', array('' => 0)); foreach ($conflicts as $filename => $merge_option) { @@ -560,7 +560,7 @@ class install_update extends module $params[] = 'modified[' . urlencode($filename) . ']=' . urlencode($merge_option); } - $no_update = request_var('no_update', array(0 => '')); + $no_update = $request->variable('no_update', array(0 => '')); foreach ($no_update as $index => $filename) { @@ -795,7 +795,7 @@ class install_update extends module { $this->include_file('includes/functions_compress.' . $phpEx); - $use_method = request_var('use_method', ''); + $use_method = $request->variable('use_method', ''); $methods = array('.tar'); $available_methods = array('.tar.gz' => 'zlib', '.tar.bz2' => 'bz2', '.zip' => 'zlib'); @@ -866,9 +866,9 @@ class install_update extends module $this->include_file('includes/functions_transfer.' . $phpEx); // Choose FTP, if not available use fsock... - $method = basename(request_var('method', '')); + $method = basename($request->variable('method', '')); $submit = (isset($_POST['submit'])) ? true : false; - $test_ftp_connection = request_var('test_connection', ''); + $test_ftp_connection = $request->variable('test_connection', ''); if (!$method || !class_exists($method)) { @@ -885,12 +885,12 @@ class install_update extends module if ($test_ftp_connection || $submit) { $transfer = new $method( - request_var('host', ''), - request_var('username', ''), + $request->variable('host', ''), + $request->variable('username', ''), htmlspecialchars_decode($request->untrimmed_variable('password', '')), - request_var('root_path', ''), - request_var('port', ''), - request_var('timeout', '') + $request->variable('root_path', ''), + $request->variable('port', ''), + $request->variable('timeout', '') ); $test_connection = $transfer->open_session(); @@ -978,12 +978,12 @@ class install_update extends module else { $transfer = new $method( - request_var('host', ''), - request_var('username', ''), + $request->variable('host', ''), + $request->variable('username', ''), htmlspecialchars_decode($request->untrimmed_variable('password', '')), - request_var('root_path', ''), - request_var('port', ''), - request_var('timeout', '') + $request->variable('root_path', ''), + $request->variable('port', ''), + $request->variable('timeout', '') ); $transfer->open_session(); } @@ -1107,15 +1107,15 @@ class install_update extends module */ function show_diff(&$update_list) { - global $phpbb_root_path, $template, $user, $phpbb_adm_relative_path; + global $phpbb_root_path, $template, $user, $request, $phpbb_adm_relative_path; $this->tpl_name = 'install_update_diff'; $this->page_title = 'VIEWING_FILE_DIFF'; - $status = request_var('status', ''); - $file = request_var('file', ''); - $diff_mode = request_var('diff_mode', 'inline'); + $status = $request->variable('status', ''); + $file = $request->variable('file', ''); + $diff_mode = $request->variable('diff_mode', 'inline'); // First of all make sure the file is within our file update list with the correct status $found_entry = array(); @@ -1144,7 +1144,7 @@ class install_update extends module switch ($status) { case 'conflict': - $option = request_var('op', 0); + $option = $request->variable('op', 0); switch ($option) { @@ -1195,7 +1195,7 @@ class install_update extends module break; case 'modified': - $option = request_var('op', 0); + $option = $request->variable('op', 0); switch ($option) { diff --git a/phpBB/mcp.php b/phpBB/mcp.php index f9d46db528..db5f87cb83 100644 --- a/phpBB/mcp.php +++ b/phpBB/mcp.php @@ -33,10 +33,10 @@ $module = new p_master(); $template->assign_var('S_IN_MCP', true); // Basic parameter data -$id = request_var('i', ''); +$id = $request->variable('i', ''); -$mode = request_var('mode', array('')); -$mode = sizeof($mode) ? array_shift($mode) : request_var('mode', ''); +$mode = $request->variable('mode', array('')); +$mode = sizeof($mode) ? array_shift($mode) : $request->variable('mode', ''); // Only Moderators can go beyond this point if (!$user->data['is_registered']) @@ -50,10 +50,10 @@ if (!$user->data['is_registered']) } $quickmod = (isset($_REQUEST['quickmod'])) ? true : false; -$action = request_var('action', ''); -$action_ary = request_var('action', array('' => 0)); +$action = $request->variable('action', ''); +$action_ary = $request->variable('action', array('' => 0)); -$forum_action = request_var('forum_action', ''); +$forum_action = $request->variable('forum_action', ''); if ($forum_action !== '' && $request->variable('sort', false, false, \phpbb\request\request_interface::POST)) { $action = $forum_action; @@ -71,12 +71,12 @@ if ($mode == 'topic_logs') $quickmod = false; } -$post_id = request_var('p', 0); -$topic_id = request_var('t', 0); -$forum_id = request_var('f', 0); -$report_id = request_var('r', 0); -$user_id = request_var('u', 0); -$username = utf8_normalize_nfc(request_var('username', '', true)); +$post_id = $request->variable('p', 0); +$topic_id = $request->variable('t', 0); +$forum_id = $request->variable('f', 0); +$report_id = $request->variable('r', 0); +$user_id = $request->variable('u', 0); +$username = utf8_normalize_nfc($request->variable('username', '', true)); if ($post_id) { @@ -192,7 +192,7 @@ if ($quickmod) case 'topic_logs': // Reset start parameter if we jumped from the quickmod dropdown - if (request_var('start', 0)) + if ($request->variable('start', 0)) { $request->overwrite('start', 0); } diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 10301a75ae..f9edcaf67b 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -20,7 +20,7 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); include($phpbb_root_path . 'includes/functions_display.' . $phpEx); -$mode = request_var('mode', ''); +$mode = $request->variable('mode', ''); if ($mode === 'contactadmin') { @@ -37,11 +37,11 @@ $user->setup(array('memberlist', 'groups')); $template->assign_var('S_IN_MEMBERLIST', true); // Grab data -$action = request_var('action', ''); -$user_id = request_var('u', ANONYMOUS); -$username = request_var('un', '', true); -$group_id = request_var('g', 0); -$topic_id = request_var('t', 0); +$action = $request->variable('action', ''); +$user_id = $request->variable('u', ANONYMOUS); +$username = $request->variable('un', '', true); +$group_id = $request->variable('g', 0); +$topic_id = $request->variable('t', 0); // Redirect when old mode is used if ($mode == 'leaders') @@ -83,12 +83,12 @@ switch ($mode) break; } -$start = request_var('start', 0); +$start = $request->variable('start', 0); $submit = (isset($_POST['submit'])) ? true : false; $default_key = 'c'; -$sort_key = request_var('sk', $default_key); -$sort_dir = request_var('sd', 'a'); +$sort_key = $request->variable('sk', $default_key); +$sort_dir = $request->variable('sd', 'a'); // What do you want to do today? ... oops, I think that line is taken ... switch ($mode) @@ -411,7 +411,7 @@ switch ($mode) include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); $subject = sprintf($user->lang['IM_JABBER_SUBJECT'], $user->data['username'], $config['server_name']); - $message = utf8_normalize_nfc(request_var('message', '', true)); + $message = utf8_normalize_nfc($request->variable('message', '', true)); if (empty($message)) { @@ -787,8 +787,8 @@ switch ($mode) include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); } - $user_id = request_var('u', 0); - $topic_id = request_var('t', 0); + $user_id = $request->variable('u', 0); + $topic_id = $request->variable('t', 0); if ($user_id) { @@ -913,9 +913,9 @@ switch ($mode) $sql_select = $sql_where_data = $sql_from = $sql_where = $order_by = ''; - $form = request_var('form', ''); - $field = request_var('field', ''); - $select_single = request_var('select_single', false); + $form = $request->variable('form', ''); + $field = $request->variable('field', ''); + $select_single = $request->variable('select_single', false); // Search URL parameters, if any of these are in the URL we do a search $search_params = array('username', 'email', 'jabber', 'search_group_id', 'joined_select', 'active_select', 'count_select', 'joined', 'active', 'count', 'ip'); @@ -925,20 +925,20 @@ switch ($mode) $field = (!preg_match('/^[a-z0-9_-]+$/i', $field)) ? '' : $field; if ((($mode == '' || $mode == 'searchuser') || sizeof(array_intersect($request->variable_names(\phpbb\request\request_interface::GET), $search_params)) > 0) && ($config['load_search'] || $auth->acl_get('a_'))) { - $username = request_var('username', '', true); - $email = strtolower(request_var('email', '')); - $jabber = request_var('jabber', ''); - $search_group_id = request_var('search_group_id', 0); + $username = $request->variable('username', '', true); + $email = strtolower($request->variable('email', '')); + $jabber = $request->variable('jabber', ''); + $search_group_id = $request->variable('search_group_id', 0); // when using these, make sure that we actually have values defined in $find_key_match - $joined_select = request_var('joined_select', 'lt'); - $active_select = request_var('active_select', 'lt'); - $count_select = request_var('count_select', 'eq'); + $joined_select = $request->variable('joined_select', 'lt'); + $active_select = $request->variable('active_select', 'lt'); + $count_select = $request->variable('count_select', 'eq'); - $joined = explode('-', request_var('joined', '')); - $active = explode('-', request_var('active', '')); - $count = (request_var('count', '') !== '') ? request_var('count', 0) : ''; - $ipdomain = request_var('ip', ''); + $joined = explode('-', $request->variable('joined', '')); + $active = explode('-', $request->variable('active', '')); + $count = ($request->variable('count', '') !== '') ? $request->variable('count', 0) : ''; + $ipdomain = $request->variable('ip', ''); $find_key_match = array('lt' => '<', 'gt' => '>', 'eq' => '='); @@ -1055,7 +1055,7 @@ switch ($mode) } } - $first_char = request_var('first_char', ''); + $first_char = $request->variable('first_char', ''); if ($first_char == 'other') { @@ -1206,7 +1206,7 @@ switch ($mode) 'count_select' => array('count_select', 'eq'), 'joined' => array('joined', ''), 'active' => array('active', ''), - 'count' => (request_var('count', '') !== '') ? array('count', 0) : array('count', ''), + 'count' => ($request->variable('count', '') !== '') ? array('count', 0) : array('count', ''), 'ip' => array('ip', ''), 'first_char' => array('first_char', ''), ); @@ -1219,7 +1219,7 @@ switch ($mode) continue; } - $param = call_user_func_array('request_var', $call); + $param = call_user_func_array(array($request, 'variable'), $call); $param = urlencode($key) . '=' . ((is_string($param)) ? urlencode($param) : $param); $params[] = $param; @@ -1271,7 +1271,7 @@ switch ($mode) // Some search user specific data if (($mode == '' || $mode == 'searchuser') && ($config['load_search'] || $auth->acl_get('a_'))) { - $group_selected = request_var('search_group_id', 0); + $group_selected = $request->variable('search_group_id', 0); $s_group_select = '<option value="0"' . ((!$group_selected) ? ' selected="selected"' : '') . '> </option>'; $group_ids = array(); diff --git a/phpBB/phpbb/captcha/plugins/captcha_abstract.php b/phpBB/phpbb/captcha/plugins/captcha_abstract.php index 24ed7f939d..2c0b95411e 100644 --- a/phpBB/phpbb/captcha/plugins/captcha_abstract.php +++ b/phpBB/phpbb/captcha/plugins/captcha_abstract.php @@ -34,12 +34,12 @@ abstract class captcha_abstract function init($type) { - global $config, $db, $user; + global $config, $db, $user, $request; // read input - $this->confirm_id = request_var('confirm_id', ''); - $this->confirm_code = request_var('confirm_code', ''); - $refresh = request_var('refresh_vc', false) && $config['confirm_refresh']; + $this->confirm_id = $request->variable('confirm_id', ''); + $this->confirm_code = $request->variable('confirm_code', ''); + $refresh = $request->variable('refresh_vc', false) && $config['confirm_refresh']; $this->type = (int) $type; @@ -125,7 +125,7 @@ abstract class captcha_abstract { foreach ($this->captcha_vars as $captcha_var => $template_var) { - $variables .= '&' . rawurlencode($captcha_var) . '=' . request_var($captcha_var, (int) $config[$captcha_var]); + $variables .= '&' . rawurlencode($captcha_var) . '=' . $request->variable($captcha_var, (int) $config[$captcha_var]); } } @@ -350,7 +350,9 @@ abstract class captcha_abstract function is_solved() { - if (request_var('confirm_code', false) && $this->solved === 0) + global $request; + + if ($request->variable('confirm_code', false) && $this->solved === 0) { $this->validate(); } diff --git a/phpBB/phpbb/captcha/plugins/gd.php b/phpBB/phpbb/captcha/plugins/gd.php index 5fe94af9df..1727dcc1bb 100644 --- a/phpBB/phpbb/captcha/plugins/gd.php +++ b/phpBB/phpbb/captcha/plugins/gd.php @@ -53,7 +53,7 @@ class gd extends captcha_abstract function acp_page($id, &$module) { - global $db, $user, $auth, $template, $phpbb_log; + global $db, $user, $auth, $template, $phpbb_log, $request; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $user->add_lang('acp/board'); @@ -70,14 +70,14 @@ class gd extends captcha_abstract $form_key = 'acp_captcha'; add_form_key($form_key); - $submit = request_var('submit', ''); + $submit = $request->variable('submit', ''); if ($submit && check_form_key($form_key)) { $captcha_vars = array_keys($this->captcha_vars); foreach ($captcha_vars as $captcha_var) { - $value = request_var($captcha_var, 0); + $value = $request->variable($captcha_var, 0); if ($value >= 0) { $config->set($captcha_var, $value); @@ -95,7 +95,7 @@ class gd extends captcha_abstract { foreach ($this->captcha_vars as $captcha_var => $template_var) { - $var = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, 0) : $config[$captcha_var]; + $var = (isset($_REQUEST[$captcha_var])) ? $request->variable($captcha_var, 0) : $config[$captcha_var]; $template->assign_var($template_var, $var); } @@ -109,7 +109,7 @@ class gd extends captcha_abstract function execute_demo() { - global $config; + global $config, $request; $config_old = $config; @@ -121,7 +121,7 @@ class gd extends captcha_abstract foreach ($this->captcha_vars as $captcha_var => $template_var) { - $config->set($captcha_var, request_var($captcha_var, (int) $config[$captcha_var])); + $config->set($captcha_var, $request->variable($captcha_var, (int) $config[$captcha_var])); } parent::execute_demo(); $config = $config_old; diff --git a/phpBB/phpbb/captcha/plugins/qa.php b/phpBB/phpbb/captcha/plugins/qa.php index a545cccbac..657cfe9217 100644 --- a/phpBB/phpbb/captcha/plugins/qa.php +++ b/phpBB/phpbb/captcha/plugins/qa.php @@ -58,14 +58,14 @@ class qa */ function init($type) { - global $config, $db, $user; + global $config, $db, $user, $request; // load our language file $user->add_lang('captcha_qa'); // read input - $this->confirm_id = request_var('qa_confirm_id', ''); - $this->answer = utf8_normalize_nfc(request_var('qa_answer', '', true)); + $this->confirm_id = $request->variable('qa_confirm_id', ''); + $this->answer = utf8_normalize_nfc($request->variable('qa_answer', '', true)); $this->type = (int) $type; $this->question_lang = $user->lang_name; @@ -544,9 +544,9 @@ class qa */ function check_answer() { - global $db; + global $db, $request; - $answer = ($this->question_strict) ? utf8_normalize_nfc(request_var('qa_answer', '', true)) : utf8_clean_string(utf8_normalize_nfc(request_var('qa_answer', '', true))); + $answer = ($this->question_strict) ? utf8_normalize_nfc($request->variable('qa_answer', '', true)) : utf8_clean_string(utf8_normalize_nfc($request->variable('qa_answer', '', true))); $sql = 'SELECT answer_text FROM ' . $this->table_captcha_answers . ' @@ -598,7 +598,9 @@ class qa */ function is_solved() { - if (request_var('qa_answer', false) && $this->solved === 0) + global $request; + + if ($request->variable('qa_answer', false) && $this->solved === 0) { $this->validate(); } @@ -611,7 +613,7 @@ class qa */ function acp_page($id, &$module) { - global $db, $user, $auth, $template, $phpbb_log; + global $db, $user, $auth, $template, $phpbb_log, $request; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $user->add_lang('acp/board'); @@ -627,9 +629,9 @@ class qa $form_key = 'acp_captcha'; add_form_key($form_key); - $submit = request_var('submit', false); - $question_id = request_var('question_id', 0); - $action = request_var('action', ''); + $submit = $request->variable('submit', false); + $question_id = $request->variable('question_id', 0); + $action = $request->variable('action', ''); // we have two pages, so users might want to navigate from one to the other $list_url = $module->u_action . "&configure=1&select_captcha=" . $this->get_service_name(); @@ -675,10 +677,10 @@ class qa { // okay, show the editor $error = false; - $input_question = request_var('question_text', '', true); - $input_answers = request_var('answers', '', true); - $input_lang = request_var('lang_iso', '', true); - $input_strict = request_var('strict', false); + $input_question = $request->variable('question_text', '', true); + $input_answers = $request->variable('answers', '', true); + $input_lang = $request->variable('lang_iso', '', true); + $input_strict = $request->variable('strict', false); $langs = $this->get_languages(); foreach ($langs as $lang => $entry) @@ -826,11 +828,13 @@ class qa */ function acp_get_question_input() { - $answers = utf8_normalize_nfc(request_var('answers', '', true)); + global $request; + + $answers = utf8_normalize_nfc($request->variable('answers', '', true)); $question = array( - 'question_text' => request_var('question_text', '', true), - 'strict' => request_var('strict', false), - 'lang_iso' => request_var('lang_iso', ''), + 'question_text' => $request->variable('question_text', '', true), + 'strict' => $request->variable('strict', false), + 'lang_iso' => $request->variable('lang_iso', ''), 'answers' => (strlen($answers)) ? explode("\n", $answers) : '', ); diff --git a/phpBB/phpbb/captcha/plugins/recaptcha.php b/phpBB/phpbb/captcha/plugins/recaptcha.php index 369c84e7df..98132ab47d 100644 --- a/phpBB/phpbb/captcha/plugins/recaptcha.php +++ b/phpBB/phpbb/captcha/plugins/recaptcha.php @@ -37,12 +37,12 @@ class recaptcha extends captcha_abstract function init($type) { - global $config, $db, $user; + global $config, $db, $user, $request; $user->add_lang('captcha_recaptcha'); parent::init($type); - $this->challenge = request_var('recaptcha_challenge_field', ''); - $this->response = request_var('recaptcha_response_field', ''); + $this->challenge = $request->variable('recaptcha_challenge_field', ''); + $this->response = $request->variable('recaptcha_response_field', ''); } public function is_available() @@ -75,7 +75,7 @@ class recaptcha extends captcha_abstract function acp_page($id, &$module) { - global $config, $db, $template, $user, $phpbb_log; + global $config, $db, $template, $user, $phpbb_log, $request; $captcha_vars = array( 'recaptcha_pubkey' => 'RECAPTCHA_PUBKEY', @@ -87,14 +87,14 @@ class recaptcha extends captcha_abstract $form_key = 'acp_captcha'; add_form_key($form_key); - $submit = request_var('submit', ''); + $submit = $request->variable('submit', ''); if ($submit && check_form_key($form_key)) { $captcha_vars = array_keys($captcha_vars); foreach ($captcha_vars as $captcha_var) { - $value = request_var($captcha_var, ''); + $value = $request->variable($captcha_var, ''); if ($value) { $config->set($captcha_var, $value); @@ -112,7 +112,7 @@ class recaptcha extends captcha_abstract { foreach ($captcha_vars as $captcha_var => $template_var) { - $var = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, '') : ((isset($config[$captcha_var])) ? $config[$captcha_var] : ''); + $var = (isset($_REQUEST[$captcha_var])) ? $request->variable($captcha_var, '') : ((isset($config[$captcha_var])) ? $config[$captcha_var] : ''); $template->assign_var($template_var, $var); } diff --git a/phpBB/phpbb/profilefields/type/type_date.php b/phpBB/phpbb/profilefields/type/type_date.php index 90ac9a6703..414484920b 100644 --- a/phpBB/phpbb/profilefields/type/type_date.php +++ b/phpBB/phpbb/profilefields/type/type_date.php @@ -72,7 +72,7 @@ class type_date extends type_base 'lang_options' => $field_data['lang_options'], ); - $always_now = request_var('always_now', -1); + $always_now = $request->variable('always_now', -1); if ($always_now == -1) { $s_checked = ($field_data['field_default_value'] == 'now') ? true : false; diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php index 6f68dbf203..6aeb8a91de 100644 --- a/phpBB/phpbb/session.php +++ b/phpBB/phpbb/session.php @@ -139,7 +139,7 @@ class session 'root_script_path' => str_replace(' ', '%20', htmlspecialchars($root_script_path)), 'page' => $page, - 'forum' => request_var('f', 0), + 'forum' => $request->variable('f', 0), ); return $page_array; @@ -253,23 +253,23 @@ class session if ($request->is_set($config['cookie_name'] . '_sid', \phpbb\request\request_interface::COOKIE) || $request->is_set($config['cookie_name'] . '_u', \phpbb\request\request_interface::COOKIE)) { - $this->cookie_data['u'] = request_var($config['cookie_name'] . '_u', 0, false, true); - $this->cookie_data['k'] = request_var($config['cookie_name'] . '_k', '', false, true); - $this->session_id = request_var($config['cookie_name'] . '_sid', '', false, true); + $this->cookie_data['u'] = $request->variable($config['cookie_name'] . '_u', 0, false, \phpbb\request\request_interface::COOKIE); + $this->cookie_data['k'] = $request->variable($config['cookie_name'] . '_k', '', false, \phpbb\request\request_interface::COOKIE); + $this->session_id = $request->variable($config['cookie_name'] . '_sid', '', false, \phpbb\request\request_interface::COOKIE); $SID = (defined('NEED_SID')) ? '?sid=' . $this->session_id : '?sid='; $_SID = (defined('NEED_SID')) ? $this->session_id : ''; if (empty($this->session_id)) { - $this->session_id = $_SID = request_var('sid', ''); + $this->session_id = $_SID = $request->variable('sid', ''); $SID = '?sid=' . $this->session_id; $this->cookie_data = array('u' => 0, 'k' => ''); } } else { - $this->session_id = $_SID = request_var('sid', ''); + $this->session_id = $_SID = $request->variable('sid', ''); $SID = '?sid=' . $this->session_id; } diff --git a/phpBB/posting.php b/phpBB/posting.php index 8b90b3b04a..a82bd37641 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -29,11 +29,11 @@ $auth->acl($user->data); // Grab only parameters needed here -$post_id = request_var('p', 0); -$topic_id = request_var('t', 0); -$forum_id = request_var('f', 0); -$draft_id = request_var('d', 0); -$lastclick = request_var('lastclick', 0); +$post_id = $request->variable('p', 0); +$topic_id = $request->variable('t', 0); +$forum_id = $request->variable('f', 0); +$draft_id = $request->variable('d', 0); +$lastclick = $request->variable('lastclick', 0); $submit = (isset($_POST['post'])) ? true : false; $preview = (isset($_POST['preview'])) ? true : false; @@ -43,7 +43,7 @@ $confirm = $request->is_set_post('confirm'); $cancel = (isset($_POST['cancel']) && !isset($_POST['save'])) ? true : false; $refresh = (isset($_POST['add_file']) || isset($_POST['delete_file']) || isset($_POST['cancel_unglobalise']) || $save || $load || $preview); -$mode = request_var('mode', ''); +$mode = $request->variable('mode', ''); // If the user is not allowed to delete the post, we try to soft delete it, so we overwrite the mode here. if ($mode == 'delete' && (($confirm && !$request->is_set_post('delete_permanent')) || !$auth->acl_gets('f_delete', 'm_delete', $forum_id))) @@ -487,7 +487,7 @@ if ($mode == 'delete' || $mode == 'soft_delete') if ($mode == 'bump') { if ($bump_time = bump_topic_allowed($forum_id, $post_data['topic_bumped'], $post_data['topic_last_post_time'], $post_data['topic_poster'], $post_data['topic_last_poster_id']) - && check_link_hash(request_var('hash', ''), "topic_{$post_data['topic_id']}")) + && check_link_hash($request->variable('hash', ''), "topic_{$post_data['topic_id']}")) { $meta_url = phpbb_bump_topic($forum_id, $topic_id, $post_data, $current_time); meta_refresh(3, $meta_url); @@ -676,9 +676,9 @@ $quote_status = true; // Save Draft if ($save && $user->data['is_registered'] && $auth->acl_get('u_savedrafts') && ($mode == 'reply' || $mode == 'post' || $mode == 'quote')) { - $subject = utf8_normalize_nfc(request_var('subject', '', true)); + $subject = utf8_normalize_nfc($request->variable('subject', '', true)); $subject = (!$subject && $mode != 'post') ? $post_data['topic_title'] : $subject; - $message = utf8_normalize_nfc(request_var('message', '', true)); + $message = utf8_normalize_nfc($request->variable('message', '', true)); if ($subject && $message) { @@ -748,11 +748,11 @@ if ($save && $user->data['is_registered'] && $auth->acl_get('u_savedrafts') && ( if (is_bool($default)) { // Use the string representation - $hidden_fields[$name] = request_var($name, ''); + $hidden_fields[$name] = $request->variable($name, ''); } else { - $hidden_fields[$name] = request_var($name, $default); + $hidden_fields[$name] = $request->variable($name, $default); } } @@ -809,20 +809,20 @@ if ($load && ($mode == 'reply' || $mode == 'quote' || $mode == 'post') && $post_ if ($submit || $preview || $refresh) { - $post_data['topic_cur_post_id'] = request_var('topic_cur_post_id', 0); - $post_data['post_subject'] = utf8_normalize_nfc(request_var('subject', '', true)); - $message_parser->message = utf8_normalize_nfc(request_var('message', '', true)); + $post_data['topic_cur_post_id'] = $request->variable('topic_cur_post_id', 0); + $post_data['post_subject'] = utf8_normalize_nfc($request->variable('subject', '', true)); + $message_parser->message = utf8_normalize_nfc($request->variable('message', '', true)); - $post_data['username'] = utf8_normalize_nfc(request_var('username', $post_data['username'], true)); - $post_data['post_edit_reason'] = ($request->variable('edit_reason', false, false, \phpbb\request\request_interface::POST) && $mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? utf8_normalize_nfc(request_var('edit_reason', '', true)) : ''; + $post_data['username'] = utf8_normalize_nfc($request->variable('username', $post_data['username'], true)); + $post_data['post_edit_reason'] = ($request->variable('edit_reason', false, false, \phpbb\request\request_interface::POST) && $mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? utf8_normalize_nfc($request->variable('edit_reason', '', true)) : ''; $post_data['orig_topic_type'] = $post_data['topic_type']; - $post_data['topic_type'] = request_var('topic_type', (($mode != 'post') ? (int) $post_data['topic_type'] : POST_NORMAL)); - $post_data['topic_time_limit'] = request_var('topic_time_limit', (($mode != 'post') ? (int) $post_data['topic_time_limit'] : 0)); + $post_data['topic_type'] = $request->variable('topic_type', (($mode != 'post') ? (int) $post_data['topic_type'] : POST_NORMAL)); + $post_data['topic_time_limit'] = $request->variable('topic_time_limit', (($mode != 'post') ? (int) $post_data['topic_time_limit'] : 0)); if ($post_data['enable_icons'] && $auth->acl_get('f_icons', $forum_id)) { - $post_data['icon_id'] = request_var('icon', (int) $post_data['icon_id']); + $post_data['icon_id'] = $request->variable('icon', (int) $post_data['icon_id']); } $post_data['enable_bbcode'] = (!$bbcode_status || isset($_POST['disable_bbcode'])) ? false : true; @@ -887,10 +887,10 @@ if ($submit || $preview || $refresh) } else { - $post_data['poll_title'] = utf8_normalize_nfc(request_var('poll_title', '', true)); - $post_data['poll_length'] = request_var('poll_length', 0); - $post_data['poll_option_text'] = utf8_normalize_nfc(request_var('poll_option_text', '', true)); - $post_data['poll_max_options'] = request_var('poll_max_options', 1); + $post_data['poll_title'] = utf8_normalize_nfc($request->variable('poll_title', '', true)); + $post_data['poll_length'] = $request->variable('poll_length', 0); + $post_data['poll_option_text'] = utf8_normalize_nfc($request->variable('poll_option_text', '', true)); + $post_data['poll_max_options'] = $request->variable('poll_max_options', 1); $post_data['poll_vote_change'] = ($auth->acl_get('f_votechg', $forum_id) && $auth->acl_get('f_vote', $forum_id) && isset($_POST['poll_vote_change'])) ? 1 : 0; } @@ -959,8 +959,8 @@ if ($submit || $preview || $refresh) // Notify and show user the changed post if ($mode == 'edit' && $post_data['forum_flags'] & FORUM_FLAG_POST_REVIEW) { - $edit_post_message_checksum = request_var('edit_post_message_checksum', ''); - $edit_post_subject_checksum = request_var('edit_post_subject_checksum', ''); + $edit_post_message_checksum = $request->variable('edit_post_message_checksum', ''); + $edit_post_subject_checksum = $request->variable('edit_post_subject_checksum', ''); // $post_data['post_checksum'] is the checksum of the post submitted in the meantime // $message_md5 is the checksum of the post we're about to submit @@ -1074,9 +1074,9 @@ if ($submit || $preview || $refresh) if ($config['enable_post_confirm'] && !$user->data['is_registered'] && in_array($mode, array('quote', 'post', 'reply'))) { $captcha_data = array( - 'message' => utf8_normalize_nfc(request_var('message', '', true)), - 'subject' => utf8_normalize_nfc(request_var('subject', '', true)), - 'username' => utf8_normalize_nfc(request_var('username', '', true)), + 'message' => utf8_normalize_nfc($request->variable('message', '', true)), + 'subject' => utf8_normalize_nfc($request->variable('subject', '', true)), + 'username' => utf8_normalize_nfc($request->variable('username', '', true)), ); $vc_response = $captcha->validate($captcha_data); if ($vc_response) @@ -1701,7 +1701,7 @@ if ($config['enable_post_confirm'] && !$user->data['is_registered'] && (isset($c $s_hidden_fields = ($mode == 'reply' || $mode == 'quote') ? '<input type="hidden" name="topic_cur_post_id" value="' . $post_data['topic_last_post_id'] . '" />' : ''; $s_hidden_fields .= '<input type="hidden" name="lastclick" value="' . $current_time . '" />'; -$s_hidden_fields .= ($draft_id || isset($_REQUEST['draft_loaded'])) ? '<input type="hidden" name="draft_loaded" value="' . request_var('draft_loaded', $draft_id) . '" />' : ''; +$s_hidden_fields .= ($draft_id || isset($_REQUEST['draft_loaded'])) ? '<input type="hidden" name="draft_loaded" value="' . $request->variable('draft_loaded', $draft_id) . '" />' : ''; if ($mode == 'edit') { diff --git a/phpBB/report.php b/phpBB/report.php index 36c4c9abc8..29208cc92a 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -25,12 +25,12 @@ $user->session_begin(); $auth->acl($user->data); $user->setup('mcp'); -$forum_id = request_var('f', 0); -$post_id = request_var('p', 0); -$pm_id = request_var('pm', 0); -$reason_id = request_var('reason_id', 0); -$report_text = utf8_normalize_nfc(request_var('report_text', '', true)); -$user_notify = ($user->data['is_registered']) ? request_var('notify', 0) : false; +$forum_id = $request->variable('f', 0); +$post_id = $request->variable('p', 0); +$pm_id = $request->variable('pm', 0); +$reason_id = $request->variable('reason_id', 0); +$report_text = utf8_normalize_nfc($request->variable('report_text', '', true)); +$user_notify = ($user->data['is_registered']) ? $request->variable('notify', 0) : false; $submit = (isset($_POST['submit'])) ? true : false; diff --git a/phpBB/search.php b/phpBB/search.php index 7cab6bca6c..318f94146e 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -25,30 +25,30 @@ $auth->acl($user->data); $user->setup('search'); // Define initial vars -$mode = request_var('mode', ''); -$search_id = request_var('search_id', ''); -$start = max(request_var('start', 0), 0); -$post_id = request_var('p', 0); -$topic_id = request_var('t', 0); -$view = request_var('view', ''); - -$submit = request_var('submit', false); -$keywords = utf8_normalize_nfc(request_var('keywords', '', true)); -$add_keywords = utf8_normalize_nfc(request_var('add_keywords', '', true)); -$author = request_var('author', '', true); -$author_id = request_var('author_id', 0); -$show_results = ($topic_id) ? 'posts' : request_var('sr', 'posts'); +$mode = $request->variable('mode', ''); +$search_id = $request->variable('search_id', ''); +$start = max($request->variable('start', 0), 0); +$post_id = $request->variable('p', 0); +$topic_id = $request->variable('t', 0); +$view = $request->variable('view', ''); + +$submit = $request->variable('submit', false); +$keywords = utf8_normalize_nfc($request->variable('keywords', '', true)); +$add_keywords = utf8_normalize_nfc($request->variable('add_keywords', '', true)); +$author = $request->variable('author', '', true); +$author_id = $request->variable('author_id', 0); +$show_results = ($topic_id) ? 'posts' : $request->variable('sr', 'posts'); $show_results = ($show_results == 'posts') ? 'posts' : 'topics'; -$search_terms = request_var('terms', 'all'); -$search_fields = request_var('sf', 'all'); -$search_child = request_var('sc', true); +$search_terms = $request->variable('terms', 'all'); +$search_fields = $request->variable('sf', 'all'); +$search_child = $request->variable('sc', true); -$sort_days = request_var('st', 0); -$sort_key = request_var('sk', 't'); -$sort_dir = request_var('sd', 'd'); +$sort_days = $request->variable('st', 0); +$sort_key = $request->variable('sk', 't'); +$sort_dir = $request->variable('sd', 'd'); -$return_chars = request_var('ch', ($topic_id) ? -1 : 300); -$search_forum = request_var('fid', array(0)); +$return_chars = $request->variable('ch', ($topic_id) ? -1 : 300); +$search_forum = $request->variable('fid', array(0)); // We put login boxes for the case if search_id is newposts, egosearch or unreadposts // because a guest should be able to log in even if guests search is not permitted @@ -307,7 +307,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) if (!$keywords && sizeof($author_id_ary)) { // if it is an author search we want to show topics by default - $show_results = ($topic_id) ? 'posts' : request_var('sr', ($search_id == 'egosearch') ? 'topics' : 'posts'); + $show_results = ($topic_id) ? 'posts' : $request->variable('sr', ($search_id == 'egosearch') ? 'topics' : 'posts'); $show_results = ($show_results == 'posts') ? 'posts' : 'topics'; } @@ -346,7 +346,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) $show_results = 'topics'; $sort_key = 't'; $sort_dir = 'd'; - $sort_days = request_var('st', 7); + $sort_days = $request->variable('st', 7); $sort_by_sql['t'] = 't.topic_last_post_time'; gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); @@ -366,7 +366,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) case 'unanswered': $l_search_title = $user->lang['SEARCH_UNANSWERED']; - $show_results = request_var('sr', 'topics'); + $show_results = $request->variable('sr', 'topics'); $show_results = ($show_results == 'posts') ? 'posts' : 'topics'; $sort_by_sql['t'] = ($show_results == 'posts') ? 'p.post_time' : 't.topic_last_post_time'; $sort_by_sql['s'] = ($show_results == 'posts') ? 'p.post_subject' : 't.topic_title'; @@ -435,7 +435,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) case 'newposts': $l_search_title = $user->lang['SEARCH_NEW']; // force sorting - $show_results = (request_var('sr', 'topics') == 'posts') ? 'posts' : 'topics'; + $show_results = ($request->variable('sr', 'topics') == 'posts') ? 'posts' : 'topics'; $sort_key = 't'; $sort_dir = 'd'; $sort_by_sql['t'] = ($show_results == 'posts') ? 'p.post_time' : 't.topic_last_post_time'; diff --git a/phpBB/ucp.php b/phpBB/ucp.php index b2b15228e6..720b56ae8b 100644 --- a/phpBB/ucp.php +++ b/phpBB/ucp.php @@ -22,8 +22,8 @@ require($phpbb_root_path . 'includes/functions_user.' . $phpEx); require($phpbb_root_path . 'includes/functions_module.' . $phpEx); // Basic parameter data -$id = request_var('i', ''); -$mode = request_var('mode', ''); +$id = $request->variable('i', ''); +$mode = $request->variable('mode', ''); if (in_array($mode, array('login', 'login_link', 'logout', 'confirm', 'sendpassword', 'activate'))) { @@ -81,7 +81,7 @@ switch ($mode) redirect(append_sid("{$phpbb_root_path}index.$phpEx")); } - login_box(request_var('redirect', "index.$phpEx")); + login_box($request->variable('redirect', "index.$phpEx")); break; case 'login_link': @@ -212,7 +212,7 @@ switch ($mode) case 'switch_perm': - $user_id = request_var('u', 0); + $user_id = $request->variable('u', 0); $sql = 'SELECT * FROM ' . USERS_TABLE . ' @@ -221,7 +221,7 @@ switch ($mode) $user_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - if (!$auth->acl_get('a_switchperm') || !$user_row || $user_id == $user->data['user_id'] || !check_link_hash(request_var('hash', ''), 'switchperm')) + if (!$auth->acl_get('a_switchperm') || !$user_row || $user_id == $user->data['user_id'] || !check_link_hash($request->variable('hash', ''), 'switchperm')) { redirect(append_sid("{$phpbb_root_path}index.$phpEx")); } @@ -285,7 +285,7 @@ if (!$user->data['is_registered']) if ($id == 'pm' && $mode == 'view' && isset($_GET['p'])) { - $redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx?i=pm&p=" . request_var('p', 0)); + $redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx?i=pm&p=" . $request->variable('p', 0)); login_box($redirect_url, $user->lang['LOGIN_EXPLAIN_UCP']); } diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 097adbf97b..b18b4d7b29 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -25,17 +25,17 @@ $user->session_begin(); $auth->acl($user->data); // Start initial var setup -$forum_id = request_var('f', 0); -$mark_read = request_var('mark', ''); -$start = request_var('start', 0); +$forum_id = $request->variable('f', 0); +$mark_read = $request->variable('mark', ''); +$start = $request->variable('start', 0); $default_sort_days = (!empty($user->data['user_topic_show_days'])) ? $user->data['user_topic_show_days'] : 0; $default_sort_key = (!empty($user->data['user_topic_sortby_type'])) ? $user->data['user_topic_sortby_type'] : 't'; $default_sort_dir = (!empty($user->data['user_topic_sortby_dir'])) ? $user->data['user_topic_sortby_dir'] : 'd'; -$sort_days = request_var('st', $default_sort_days); -$sort_key = request_var('sk', $default_sort_key); -$sort_dir = request_var('sd', $default_sort_dir); +$sort_days = $request->variable('st', $default_sort_days); +$sort_key = $request->variable('sk', $default_sort_key); +$sort_dir = $request->variable('sd', $default_sort_dir); /* @var $pagination \phpbb\pagination */ $pagination = $phpbb_container->get('pagination'); @@ -186,10 +186,10 @@ if (!$auth->acl_get('f_read', $forum_id)) // Handle marking posts if ($mark_read == 'topics') { - $token = request_var('hash', ''); + $token = $request->variable('hash', ''); if (check_link_hash($token, 'global')) { - markread('topics', array($forum_id), false, request_var('mark_time', 0)); + markread('topics', array($forum_id), false, $request->variable('mark_time', 0)); } $redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id); meta_refresh(3, $redirect_url); diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index ad8bdac91b..ccbdc8d57e 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -25,12 +25,12 @@ $auth->acl($user->data); $user->setup('memberlist'); // Get and set some variables -$mode = request_var('mode', ''); -$session_id = request_var('s', ''); -$start = request_var('start', 0); -$sort_key = request_var('sk', 'b'); -$sort_dir = request_var('sd', 'd'); -$show_guests = ($config['load_online_guests']) ? request_var('sg', 0) : 0; +$mode = $request->variable('mode', ''); +$session_id = $request->variable('s', ''); +$start = $request->variable('start', 0); +$sort_key = $request->variable('sk', 'b'); +$sort_dir = $request->variable('sd', 'd'); +$show_guests = ($config['load_online_guests']) ? $request->variable('sg', 0) : 0; // Can this user view profiles/memberlist? if (!$auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 2e27871f2c..ac5b0730db 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -27,26 +27,26 @@ $user->session_begin(); $auth->acl($user->data); // Initial var setup -$forum_id = request_var('f', 0); -$topic_id = request_var('t', 0); -$post_id = request_var('p', 0); -$voted_id = request_var('vote_id', array('' => 0)); +$forum_id = $request->variable('f', 0); +$topic_id = $request->variable('t', 0); +$post_id = $request->variable('p', 0); +$voted_id = $request->variable('vote_id', array('' => 0)); $voted_id = (sizeof($voted_id) > 1) ? array_unique($voted_id) : $voted_id; -$start = request_var('start', 0); -$view = request_var('view', ''); +$start = $request->variable('start', 0); +$view = $request->variable('view', ''); $default_sort_days = (!empty($user->data['user_post_show_days'])) ? $user->data['user_post_show_days'] : 0; $default_sort_key = (!empty($user->data['user_post_sortby_type'])) ? $user->data['user_post_sortby_type'] : 't'; $default_sort_dir = (!empty($user->data['user_post_sortby_dir'])) ? $user->data['user_post_sortby_dir'] : 'a'; -$sort_days = request_var('st', $default_sort_days); -$sort_key = request_var('sk', $default_sort_key); -$sort_dir = request_var('sd', $default_sort_dir); +$sort_days = $request->variable('st', $default_sort_days); +$sort_key = $request->variable('sk', $default_sort_key); +$sort_dir = $request->variable('sd', $default_sort_dir); -$update = request_var('update', false); +$update = $request->variable('update', false); /* @var $pagination \phpbb\pagination */ $pagination = $phpbb_container->get('pagination'); @@ -55,7 +55,7 @@ $s_can_vote = false; /** * @todo normalize? */ -$hilit_words = request_var('hilit', '', true); +$hilit_words = $request->variable('hilit', '', true); // Do we have a topic or post id? if (!$topic_id && !$post_id) @@ -498,9 +498,9 @@ if ($config['allow_topic_notify']) } // Bookmarks -if ($config['allow_bookmarks'] && $user->data['is_registered'] && request_var('bookmark', 0)) +if ($config['allow_bookmarks'] && $user->data['is_registered'] && $request->variable('bookmark', 0)) { - if (check_link_hash(request_var('hash', ''), "topic_$topic_id")) + if (check_link_hash($request->variable('hash', ''), "topic_$topic_id")) { if (!$topic_data['bookmarked']) { @@ -2141,13 +2141,13 @@ if ($s_can_vote || $s_quick_reply) // We overwrite $_REQUEST['f'] if there is no forum specified // to be able to display the correct online list. // One downside is that the user currently viewing this topic/post is not taken into account. -if (!request_var('f', 0)) +if (!$request->variable('f', 0)) { $request->overwrite('f', $forum_id); } // We need to do the same with the topic_id. See #53025. -if (!request_var('t', 0) && !empty($topic_id)) +if (!$request->variable('t', 0) && !empty($topic_id)) { $request->overwrite('t', $topic_id); } diff --git a/tests/request/request_var_test.php b/tests/request/request_var_test.php index 67712eb6c8..b409e5ef25 100644 --- a/tests/request/request_var_test.php +++ b/tests/request/request_var_test.php @@ -11,7 +11,7 @@ * */ -require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; +require_once dirname(__FILE__) . '/../../phpBB/includes/functions_compatibility.php'; require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php'; class phpbb_request_var_test extends phpbb_test_case diff --git a/tests/session/testable_factory.php b/tests/session/testable_factory.php index 99e7d27bea..7819063505 100644 --- a/tests/session/testable_factory.php +++ b/tests/session/testable_factory.php @@ -81,7 +81,6 @@ class phpbb_session_testable_factory $this->cookies, $this->server_data ); - request_var(null, null, null, null, $request); $config = $this->config = new \phpbb\config\config($this->get_config_data()); |