summaryrefslogtreecommitdiff
path: root/modules/user/user.module
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2008-09-15 09:28:50 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2008-09-15 09:28:50 +0000
commite7ac5c58fd101d0de71a1397dd5b33f1b62c5fc7 (patch)
tree93e4aa08fda69ea8bb2ad31c9af38124c2668a2e /modules/user/user.module
parent1806af909cc912e3ae688577b52a4edbcaf25678 (diff)
downloadbrdo-e7ac5c58fd101d0de71a1397dd5b33f1b62c5fc7.tar.gz
brdo-e7ac5c58fd101d0de71a1397dd5b33f1b62c5fc7.tar.bz2
#308434 by drewish, dopry, quicksketch, aaron, jhedstrom, and friends: Massive file.inc cleanup aaaaaand... tests! Yay! :D
Diffstat (limited to 'modules/user/user.module')
-rw-r--r--modules/user/user.module6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/user/user.module b/modules/user/user.module
index 40c5d9588..50cd6695d 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -414,9 +414,9 @@ function user_validate_picture(&$form, &$form_state) {
// files table as a temporary file. We'll make a copy and let the garbage
// collector delete the original upload.
$info = image_get_info($file->filepath);
- $destination = variable_get('user_picture_path', 'pictures') . '/picture-' . $form['#uid'] . '.' . $info['extension'];
- if (file_copy($file, $destination, FILE_EXISTS_REPLACE)) {
- $form_state['values']['picture'] = $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)) {
+ $form_state['values']['picture'] = $filepath;
}
else {
form_set_error('picture_upload', t("Failed to upload the picture image; the %directory directory doesn't exist or is not writable.", array('%directory' => variable_get('user_picture_path', 'pictures'))));