1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-16 05:34:01 +02:00

some changes

git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@5092 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2005-02-21 18:38:40 +00:00
parent 24338c287f
commit 585dff72c6
20 changed files with 1163 additions and 55 deletions

View File

@@ -51,6 +51,7 @@ function user_avatar_delete($avatar_type, $avatar_file)
{
global $board_config, $userdata;
$avatar_file = basename($avatar_file);
if ( $avatar_type == USER_AVATAR_UPLOAD && $avatar_file != '' )
{
if ( @file_exists(@phpbb_realpath('./' . $board_config['avatar_path'] . '/' . $avatar_file)) )
@@ -65,6 +66,13 @@ function user_avatar_delete($avatar_type, $avatar_file)
function user_avatar_gallery($mode, &$error, &$error_msg, $avatar_filename)
{
global $board_config;
$avatar_filename = str_replace(array('../', '..\\', './', '.\\'), '', $avatar_filename);
if ($avatar_filename{0} == '/' || $avatar_filename{0} == "\\")
{
return '';
}
if ( file_exists(@phpbb_realpath($board_config['avatar_gallery_path'] . '/' . $avatar_filename)) && ($mode == 'editprofile') )
{
$return = ", user_avatar = '" . str_replace("\'", "''", $avatar_filename) . "', user_avatar_type = " . USER_AVATAR_GALLERY;
@@ -224,6 +232,10 @@ function user_avatar_upload($mode, $avatar_mode, &$current_avatar, &$current_typ
$move_file = 'copy';
}
if (!is_uploaded_file($avatar_filename))
{
message_die(GENERAL_ERROR, 'Unable to upload file', '', __LINE__, __FILE__);
}
$move_file($avatar_filename, './' . $board_config['avatar_path'] . "/$new_filename");
}