Skip to content

Commit

Permalink
revert debugging commit
Browse files Browse the repository at this point in the history
  • Loading branch information
RedEnchilada committed Dec 2, 2014
1 parent 2244bf3 commit 583ba9c
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions actions/avatarsettings.php
Expand Up @@ -401,7 +401,6 @@ 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 @@ -418,22 +417,10 @@ function cropAvatar()
$user = common_current_user();
$profile = $user->getProfile();

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) {
$imagefile = new ImageFile($user->id, $filedata['filepath']);
$filename = $imagefile->resize($size, $dest_x, $dest_y, $dest_w, $dest_h);

if ($profile->setOriginal($filename)) {
@unlink($filedata['filepath']);
unset($_SESSION['FILEDATA']);
$this->mode = 'upload';
Expand Down

0 comments on commit 583ba9c

Please sign in to comment.