diff --git a/phpBB/phpbb/avatar/driver/upload.php b/phpBB/phpbb/avatar/driver/upload.php index f709a51705..0305f9c395 100644 --- a/phpBB/phpbb/avatar/driver/upload.php +++ b/phpBB/phpbb/avatar/driver/upload.php @@ -24,7 +24,7 @@ use phpbb\storage\exception\exception as storage_exception; use phpbb\storage\storage; /** -* Handles avatars uploaded to the board +* Handles avatars uploaded to the board. */ class upload extends \phpbb\avatar\driver\driver { @@ -241,7 +241,6 @@ class upload extends \phpbb\avatar\driver\driver */ public function delete($row) { - $error = array(); $prefix = $this->config['avatar_salt'] . '_'; $ext = substr(strrchr($row['avatar'], '.'), 1); diff --git a/phpBB/phpbb/image/image_cropper.php b/phpBB/phpbb/image/image_cropper.php index 950ec6f7e8..6bf2ac4c3e 100644 --- a/phpBB/phpbb/image/image_cropper.php +++ b/phpBB/phpbb/image/image_cropper.php @@ -213,7 +213,7 @@ class image_cropper $flip_mode |= $flip_horizontally ? IMG_FLIP_HORIZONTAL : 0; $flip_mode |= $flip_vertically ? IMG_FLIP_VERTICAL : 0; - if ($flip_mode !== 0) + if (0 !== $flip_mode) { imageflip($image, $flip_mode); } @@ -249,13 +249,11 @@ class image_cropper */ public static function crop_image($image, int $x, int $y, int $width, int $height) { - $new_image = imagecrop($image, [ + return false !== ($new_image = imagecrop($image, [ 'x' => $x, 'y' => $y, 'width' => $width, 'height' => $height, - ]); - - return false !== $new_image ? $new_image : $image; + ])) ? $new_image : $image; } }