1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-05 05:55:15 +02:00
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8701 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Henry Sudhof 2008-07-28 15:22:49 +00:00
parent fe72c1e3cf
commit 8f2a42c2d2
2 changed files with 9 additions and 7 deletions

View File

@ -91,7 +91,8 @@
<li>[Change] More restrictive chmod to new files being created.</li>
<li>[Feature] Allow limited inheritance for templates sets.</li>
<li>[Feature] Allow hard disabling of the template editor.</li>
</ul>
<li>[Fix] Delete avatar files (Bug #29985).</li>
</ul>
<a name="v301"></a><h3>1.ii. Changes since 3.0.1</h3>

View File

@ -2297,22 +2297,23 @@ function avatar_process_user(&$error, $custom_userdata = false)
// Do we actually have any data to update?
if (sizeof($sql_ary))
{
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . (($custom_userdata === false) ? $user->data['user_id'] : $custom_userdata['user_id']);
$db->sql_query($sql);
if (isset($sql_ary['user_avatar']))
{
$userdata = ($custom_userdata === false) ? $user->data : $custom_userdata;
// Delete old avatar if present
if ((!empty($userdata['user_avatar']) && empty($sql_ary['user_avatar']) && $userdata['user_avatar_type'] == AVATAR_UPLOAD)
|| ( !empty($userdata['user_avatar']) && !empty($sql_ary['user_avatar']) && $userdata['user_avatar_type'] == AVATAR_UPLOAD && $sql_ary['user_avatar_type'] != AVATAR_UPLOAD))
|| ( !empty($userdata['user_avatar']) && !empty($sql_ary['user_avatar']) && $userdata['user_avatar_type'] == AVATAR_UPLOAD))
{
avatar_delete('user', $userdata);
}
}
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . (($custom_userdata === false) ? $user->data['user_id'] : $custom_userdata['user_id']);
$db->sql_query($sql);
}
}