aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_user.php
diff options
context:
space:
mode:
authorFyorl <gaelreth@gmail.com>2012-08-15 15:07:42 +0100
committerFyorl <gaelreth@gmail.com>2012-08-15 15:09:59 +0100
commita3b87f1e953e4f79478d8e7eb65ca9855140243a (patch)
tree618163a920e61dbc7c009ac501699e7966aec781 /phpBB/includes/functions_user.php
parent3eb88b026752512a79b641e3b55193972f221a45 (diff)
downloadforums-a3b87f1e953e4f79478d8e7eb65ca9855140243a.tar
forums-a3b87f1e953e4f79478d8e7eb65ca9855140243a.tar.gz
forums-a3b87f1e953e4f79478d8e7eb65ca9855140243a.tar.bz2
forums-a3b87f1e953e4f79478d8e7eb65ca9855140243a.tar.xz
forums-a3b87f1e953e4f79478d8e7eb65ca9855140243a.zip
[ticket/10939] Modified functions_user.php to not use $_FILES
PHPBB3-10939
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r--phpBB/includes/functions_user.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 6e658b4ef4..405c5ef5d1 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -2059,13 +2059,14 @@ function avatar_remote($data, &$error)
*/
function avatar_upload($data, &$error)
{
- global $phpbb_root_path, $config, $db, $user, $phpEx;
+ global $phpbb_root_path, $config, $db, $user, $phpEx, $request;
// Init upload class
include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx);
$upload = new fileupload('AVATAR_', array('jpg', 'jpeg', 'gif', 'png'), $config['avatar_filesize'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height'], (isset($config['mime_triggers']) ? explode('|', $config['mime_triggers']) : false));
- if (!empty($_FILES['uploadfile']['name']))
+ $uploadfile = $request->file('uploadfile');
+ if (!empty($uploadfile['name']))
{
$file = $upload->form_upload('uploadfile');
}
@@ -2288,7 +2289,7 @@ function avatar_get_dimensions($avatar, $avatar_type, &$error, $current_x = 0, $
*/
function avatar_process_user(&$error, $custom_userdata = false, $can_upload = null)
{
- global $config, $phpbb_root_path, $auth, $user, $db;
+ global $config, $phpbb_root_path, $auth, $user, $db, $request;
$data = array(
'uploadurl' => request_var('uploadurl', ''),
@@ -2330,7 +2331,8 @@ function avatar_process_user(&$error, $custom_userdata = false, $can_upload = nu
$can_upload = ($config['allow_avatar_upload'] && file_exists($phpbb_root_path . $config['avatar_path']) && phpbb_is_writable($phpbb_root_path . $config['avatar_path']) && $change_avatar && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
}
- if ((!empty($_FILES['uploadfile']['name']) || $data['uploadurl']) && $can_upload)
+ $uploadfile = $request->file('uploadfile');
+ if ((!empty($uploadfile['name']) || $data['uploadurl']) && $can_upload)
{
list($sql_ary['user_avatar_type'], $sql_ary['user_avatar'], $sql_ary['user_avatar_width'], $sql_ary['user_avatar_height']) = avatar_upload($data, $error);
}