diff --git a/core/avatar/controller.php b/core/avatar/controller.php index 5264327b64..50ec50f19a 100644 --- a/core/avatar/controller.php +++ b/core/avatar/controller.php @@ -72,12 +72,14 @@ class OC_Core_Avatar_Controller { } else { $l = new \OC_L10n('core'); $type = substr($image->mimeType(), -3); - if ($type === 'peg') { $type = 'jpg'; } + if ($type === 'peg') { + $type = 'jpg'; + } if ($type !== 'jpg' && $type !== 'png') { \OC_JSON::error(array("data" => array("message" => $l->t("Unknown filetype")) )); } - if (!$img->valid()) { + if (!$image->valid()) { \OC_JSON::error(array("data" => array("message" => $l->t("Invalid image")) )); } } diff --git a/lib/avatar.php b/lib/avatar.php index 9b2a7fe07c..5f73a9bf22 100644 --- a/lib/avatar.php +++ b/lib/avatar.php @@ -15,7 +15,7 @@ class OC_Avatar { * @brief get the users avatar * @param $user string which user to get the avatar for * @param $size integer size in px of the avatar, defaults to 64 - * @return mixed \OC_Image containing the avatar or false if there's no image + * @return boolean|\OC_Image containing the avatar or false if there's no image */ public function get ($user, $size = 64) { $view = new \OC\Files\View('/'.$user);