diff options
author | Igor Wiedler <igor@wiedler.ch> | 2010-09-22 21:58:20 +0200 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2010-09-25 20:32:15 +0200 |
commit | fccd7f0ab5ab559dc89be6af9e582a986af8bb13 (patch) | |
tree | 65b2c96dc13203a75f104d3ee2b79b0756bc4631 /phpBB/includes/ucp/ucp_pm_compose.php | |
parent | 15883dfac22c8a5660c0400c565ba980eaf6f618 (diff) | |
download | forums-fccd7f0ab5ab559dc89be6af9e582a986af8bb13.tar forums-fccd7f0ab5ab559dc89be6af9e582a986af8bb13.tar.gz forums-fccd7f0ab5ab559dc89be6af9e582a986af8bb13.tar.bz2 forums-fccd7f0ab5ab559dc89be6af9e582a986af8bb13.tar.xz forums-fccd7f0ab5ab559dc89be6af9e582a986af8bb13.zip |
[feature/request-class] Convert any direct access to $_* to use $request
PHPBB3-9716
Diffstat (limited to 'phpBB/includes/ucp/ucp_pm_compose.php')
-rw-r--r-- | phpBB/includes/ucp/ucp_pm_compose.php | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index b596e72c41..e7c0244b99 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -24,6 +24,7 @@ function compose_pm($id, $mode, $action) { global $template, $db, $auth, $user; global $phpbb_root_path, $phpEx, $config; + global $request; // Damn php and globals - i know, this is horrible // Needed for handle_message_list_actions() @@ -49,13 +50,7 @@ function compose_pm($id, $mode, $action) // Reply to all triggered (quote/reply) $reply_to_all = request_var('reply_to_all', 0); - // Do NOT use request_var or specialchars here - $address_list = isset($_REQUEST['address_list']) ? $_REQUEST['address_list'] : array(); - - if (!is_array($address_list)) - { - $address_list = array(); - } + $address_list = $request->variable('address_list', array('' => array(0 => ''))); $submit = (isset($_POST['post'])) ? true : false; $preview = (isset($_POST['preview'])) ? true : false; @@ -1029,7 +1024,7 @@ function compose_pm($id, $mode, $action) $s_hidden_fields = '<input type="hidden" name="lastclick" value="' . $current_time . '" />'; $s_hidden_fields .= (isset($check_value)) ? '<input type="hidden" name="status_switch" value="' . $check_value . '" />' : ''; - $s_hidden_fields .= ($draft_id || isset($_REQUEST['draft_loaded'])) ? '<input type="hidden" name="draft_loaded" value="' . ((isset($_REQUEST['draft_loaded'])) ? intval($_REQUEST['draft_loaded']) : $draft_id) . '" />' : ''; + $s_hidden_fields .= ($draft_id || isset($_REQUEST['draft_loaded'])) ? '<input type="hidden" name="draft_loaded" value="' . ((isset($_REQUEST['draft_loaded'])) ? $request->variable('draft_loaded', 0) : $draft_id) . '" />' : ''; $form_enctype = (@ini_get('file_uploads') == '0' || strtolower(@ini_get('file_uploads')) == 'off' || !$config['allow_pm_attach'] || !$auth->acl_get('u_pm_attach')) ? '' : ' enctype="multipart/form-data"'; @@ -1105,11 +1100,12 @@ function compose_pm($id, $mode, $action) function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove_g, $add_to, $add_bcc) { global $auth, $db, $user; + global $request; // Delete User [TO/BCC] - if ($remove_u && !empty($_REQUEST['remove_u']) && is_array($_REQUEST['remove_u'])) + if ($remove_u && $request->variable('remove_u', array(0 => ''))) { - $remove_user_id = array_keys($_REQUEST['remove_u']); + $remove_user_id = array_keys($request->variable('remove_u', array(0 => ''))); if (isset($remove_user_id[0])) { @@ -1118,9 +1114,9 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove } // Delete Group [TO/BCC] - if ($remove_g && !empty($_REQUEST['remove_g']) && is_array($_REQUEST['remove_g'])) + if ($remove_g && $request->variable('remove_g', array(0 => ''))) { - $remove_group_id = array_keys($_REQUEST['remove_g']); + $remove_group_id = array_keys($request->variable('remove_g', array(0 => ''))); if (isset($remove_group_id[0])) { @@ -1188,7 +1184,7 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove } // Add Friends if specified - $friend_list = (isset($_REQUEST['add_' . $type]) && is_array($_REQUEST['add_' . $type])) ? array_map('intval', array_keys($_REQUEST['add_' . $type])) : array(); + $friend_list = array_keys($request->variable('add_' . $type, array(0))); $user_id_ary = array_merge($user_id_ary, $friend_list); foreach ($user_id_ary as $user_id) |