diff options
| -rw-r--r-- | phpBB/docs/CHANGELOG.html | 3 | ||||
| -rw-r--r-- | phpBB/includes/functions_user.php | 13 |
2 files changed, 9 insertions, 7 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 8865456e41..56d4022ec8 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -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> diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 185c177b18..e88ded1b85 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -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); + } } |
