From f841d1a764c4aa6aa6d2a58daa401be615f4e873 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Thu, 9 Oct 2008 00:02:29 +0000 Subject: #142995 by dopry, drewish, quicksketch, jpetso, and flobruit: Adding hook_file_X(). This is an enabler of lots and lots of goodies. See CHANGELOG.txt for more. Awesome work, guys. :) --- modules/user/user.module | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/user/user.module') diff --git a/modules/user/user.module b/modules/user/user.module index 4138fd72e..e8d956d0f 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -407,7 +407,7 @@ function user_validate_picture(&$form, &$form_state) { if ($file = file_save_upload('picture_upload', $validators)) { // Remove the old picture. if (isset($form_state['values']['_account']->picture) && file_exists($form_state['values']['_account']->picture)) { - file_delete($form_state['values']['_account']->picture); + file_unmanaged_delete($form_state['values']['_account']->picture); } // The image was saved using file_save_upload() and was added to the @@ -415,7 +415,7 @@ function user_validate_picture(&$form, &$form_state) { // collector delete the original upload. $info = image_get_info($file->filepath); $destination = file_create_path(variable_get('user_picture_path', 'pictures') . '/picture-' . $form['#uid'] . '.' . $info['extension']); - if ($filepath = file_copy($file->filepath, $destination, FILE_EXISTS_REPLACE)) { + if ($filepath = file_unmanaged_copy($file->filepath, $destination, FILE_EXISTS_REPLACE)) { $form_state['values']['picture'] = $filepath; } else { @@ -1558,7 +1558,7 @@ function _user_edit_submit($uid, &$edit) { // Delete picture if requested, and if no replacement picture was given. if (!empty($edit['picture_delete'])) { if ($user->picture && file_exists($user->picture)) { - file_delete($user->picture); + file_unmanaged_delete($user->picture); } $edit['picture'] = ''; } -- cgit v1.2.3