summaryrefslogtreecommitdiff
path: root/actions/updateprofile.php
diff options
context:
space:
mode:
authorFederico Marani <federico.marani@ymail.com>2009-03-07 13:54:54 +0000
committerFederico Marani <federico.marani@ymail.com>2009-03-07 13:54:54 +0000
commitbab3e1b8586f42bc1f0a5f96b6990d67c6b74446 (patch)
tree559729d3330991c0c68da96350b71434ca4f6f87 /actions/updateprofile.php
parenta389f157baddafa91347c27194805580b1373e30 (diff)
parent13c183e2f4e0738233658ca79103bbe4a6d57992 (diff)
Merge branch '0.8.x' of git://gitorious.org/laconica/dev into 0.8.x
Conflicts: lib/util.php
Diffstat (limited to 'actions/updateprofile.php')
-rw-r--r--actions/updateprofile.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/actions/updateprofile.php b/actions/updateprofile.php
index 898c53543..4751a04ff 100644
--- a/actions/updateprofile.php
+++ b/actions/updateprofile.php
@@ -162,7 +162,13 @@ class UpdateprofileAction extends Action
if ($avatar) {
$temp_filename = tempnam(sys_get_temp_dir(), 'listenee_avatar');
copy($avatar, $temp_filename);
- if (!$profile->setOriginal($temp_filename)) {
+ $imagefile = new ImageFile($profile->id, $temp_filename);
+ $filename = Avatar::filename($profile->id,
+ image_type_to_extension($imagefile->type),
+ null,
+ common_timestamp());
+ rename($temp_filename, Avatar::path($filename));
+ if (!$profile->setOriginal($filename)) {
$this->serverError(_('Could not save avatar info'), 500);
return false;
}