From 42251d008c06ad0f475f116643c6583fc9a4eda7 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Mon, 30 Apr 2007 10:46:17 +0000 Subject: Prepare to be yelled at and brace for the tide of bug reports: I had hoped we would not have to do this, but it seems that we have to. -Route all avatar downloads through download.php - adrien -Change the way inline attachments are delivered -Fixes a few (unreported) bugs, notably avatar upload during group generation -#10079 git-svn-id: file:///svn/phpbb/trunk@7429 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_convert.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/functions_convert.php') diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index 16972b3704..c02d736695 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -630,7 +630,10 @@ function import_smiley($source, $use_target = false) return $result['target']; } -function import_avatar($source, $use_target = false) +/* +* +*/ +function import_avatar($source, $use_target = false, $user_id = false) { if (empty($source) || preg_match('#^https?:#i', $source) || preg_match('#blank\.(gif|png)$#i', $source)) { @@ -643,9 +646,15 @@ function import_avatar($source, $use_target = false) { $convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_AVATAR_PATH'], 'import_avatar()'), __LINE__, __FILE__); } - + + if ($use_target === false && $user_id !== false) + { + $use_target = $config['avatar_salt'] . '_' . $user_id . '.' . substr(strrchr($source, '.'), 1); + } + $result = _import_check('avatar_path', $source, $use_target); - return $result['target']; + + return ((!empty($user_id)) ? $user_id : $use_target) . '.' . substr(strrchr($source, '.'), 1); } /** -- cgit v1.2.1