Skip to content

Commit

Permalink
debugging commit
Browse files Browse the repository at this point in the history
  • Loading branch information
RedEnchilada committed Dec 2, 2014
1 parent b14eae5 commit 2244bf3
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions actions/avatarsettings.php
Expand Up @@ -401,6 +401,7 @@ function cropAvatar()

if (!$filedata) {
// TRANS: Server error displayed if an avatar upload went wrong somehow server side.
echo 'Lost our file data.';
$this->serverError(_('Lost our file data.'));
return;
}
Expand All @@ -417,10 +418,22 @@ function cropAvatar()
$user = common_current_user();
$profile = $user->getProfile();

$imagefile = new ImageFile($user->id, $filedata['filepath']);
$filename = $imagefile->resize($size, $dest_x, $dest_y, $dest_w, $dest_h);

if ($profile->setOriginal($filename)) {
try {
$imagefile = new ImageFile($user->id, $filedata['filepath']);
$filename = $imagefile->resize($size, $dest_x, $dest_y, $dest_w, $dest_h);
} catch ($e) {
echo $e->getMessage();
return;
}

$test;
try {
$test = $profile->setOriginal($filename);
} catch ($e) {
echo $e->getMessage();
return;
}
if ($test) {
@unlink($filedata['filepath']);
unset($_SESSION['FILEDATA']);
$this->mode = 'upload';
Expand Down

0 comments on commit 2244bf3

Please sign in to comment.