Skip to content

Commit 2244bf3

Browse files
author
RedEnchilada
committed
debugging commit
1 parent b14eae5 commit 2244bf3

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

actions/avatarsettings.php

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ function cropAvatar()
401401

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

420-
$imagefile = new ImageFile($user->id, $filedata['filepath']);
421-
$filename = $imagefile->resize($size, $dest_x, $dest_y, $dest_w, $dest_h);
422-
423-
if ($profile->setOriginal($filename)) {
421+
try {
422+
$imagefile = new ImageFile($user->id, $filedata['filepath']);
423+
$filename = $imagefile->resize($size, $dest_x, $dest_y, $dest_w, $dest_h);
424+
} catch ($e) {
425+
echo $e->getMessage();
426+
return;
427+
}
428+
429+
$test;
430+
try {
431+
$test = $profile->setOriginal($filename);
432+
} catch ($e) {
433+
echo $e->getMessage();
434+
return;
435+
}
436+
if ($test) {
424437
@unlink($filedata['filepath']);
425438
unset($_SESSION['FILEDATA']);
426439
$this->mode = 'upload';

0 commit comments

Comments
 (0)