summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-07-19 16:15:00 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2017-08-01 08:20:15 +0200
commitaa6d8fcdbfb694eaa37d9afc80191a05ba6c6850 (patch)
tree78570fe8e5a6c8aba571ab305ef1369be009405d /core
parentd321e9792ef7f521309b6e84f0da650da6cf1250 (diff)
downloadnextcloud-server-aa6d8fcdbfb694eaa37d9afc80191a05ba6c6850.tar.gz
nextcloud-server-aa6d8fcdbfb694eaa37d9afc80191a05ba6c6850.zip
Fix AvatarController
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'core')
-rw-r--r--core/Controller/AvatarController.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/Controller/AvatarController.php b/core/Controller/AvatarController.php
index 5a3d6309149..cb0ece9fa45 100644
--- a/core/Controller/AvatarController.php
+++ b/core/Controller/AvatarController.php
@@ -173,6 +173,7 @@ class AvatarController extends Controller {
if (isset($path)) {
$path = stripslashes($path);
$userFolder = $this->rootFolder->getUserFolder($this->userId);
+ /** @var File $node */
$node = $userFolder->get($path);
if (!($node instanceof File)) {
return new JSONResponse(['data' => ['message' => $this->l->t('Please select a file.')]]);
@@ -296,7 +297,7 @@ class AvatarController extends Controller {
Http::STATUS_OK,
['Content-Type' => $image->mimeType()]);
- $resp->setETag(crc32($image->data()));
+ $resp->setETag((string)crc32($image->data()));
$resp->cacheFor(0);
$resp->setLastModified(new \DateTime('now', new \DateTimeZone('GMT')));
return $resp;
@@ -328,7 +329,7 @@ class AvatarController extends Controller {
}
$image = new \OC_Image($tmpAvatar);
- $image->crop($crop['x'], $crop['y'], round($crop['w']), round($crop['h']));
+ $image->crop($crop['x'], $crop['y'], (int)round($crop['w']), (int)round($crop['h']));
try {
$avatar = $this->avatarManager->getAvatar($this->userId);
$avatar->set($image);