X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Favatarsettings.php;h=7373e770477b4a8def01b0ea7ac9db5cdeca3ea6;hb=6f593a79d4b090b6afb6353a1f7e50f3fbfdc1b6;hp=76974265e6dadce606c1ba556601cf26ed4eea13;hpb=fb94a16217bd7c944530442614dd9c00abf9d5e7;p=quix0rs-gnu-social.git diff --git a/actions/avatarsettings.php b/actions/avatarsettings.php index 76974265e6..7373e77047 100644 --- a/actions/avatarsettings.php +++ b/actions/avatarsettings.php @@ -106,7 +106,6 @@ class AvatarsettingsAction extends SettingsAction common_log_db_error($user, 'SELECT', __FILE__); // TRANS: Error message displayed when referring to a user without a profile. $this->serverError(_('User has no profile.')); - return; } $this->elementStart('form', array('enctype' => 'multipart/form-data', @@ -195,7 +194,6 @@ class AvatarsettingsAction extends SettingsAction common_log_db_error($user, 'SELECT', __FILE__); // TRANS: Error message displayed when referring to a user without a profile. $this->serverError(_('User has no profile.')); - return; } $this->elementStart('form', array('method' => 'post', @@ -331,7 +329,7 @@ class AvatarsettingsAction extends SettingsAction 'tmp'.common_timestamp()); $filepath = Avatar::path($filename); - $imagefile->copyTo($filepath); + $imagefile = $imagefile->copyTo($filepath); $filedata = array('filename' => $filename, 'filepath' => $filepath, @@ -362,7 +360,6 @@ class AvatarsettingsAction extends SettingsAction if (!$filedata) { // TRANS: Server error displayed if an avatar upload went wrong somehow server side. $this->serverError(_('Lost our file data.')); - return; } $file_d = ($filedata['width'] > $filedata['height']) @@ -372,7 +369,7 @@ class AvatarsettingsAction extends SettingsAction $dest_y = $this->arg('avatar_crop_y') ? $this->arg('avatar_crop_y'):0; $dest_w = $this->arg('avatar_crop_w') ? $this->arg('avatar_crop_w'):$file_d; $dest_h = $this->arg('avatar_crop_h') ? $this->arg('avatar_crop_h'):$file_d; - $size = floor(min($dest_w, $dest_h, MAX_ORIGINAL)); + $size = intval(min($dest_w, $dest_h, MAX_ORIGINAL)); $user = common_current_user(); $profile = $user->getProfile(); @@ -386,7 +383,6 @@ class AvatarsettingsAction extends SettingsAction $this->mode = 'upload'; // TRANS: Success message for having updated a user avatar. $this->showForm(_('Avatar updated.'), true); - common_broadcast_profile($profile); } else { // TRANS: Error displayed on the avatar upload page if the avatar could not be updated for an unknown reason. $this->showForm(_('Failed updating avatar.'));