diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/ajax/preview.php | 5 | ||||
-rw-r--r-- | core/avatar/avatarcontroller.php | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/core/ajax/preview.php b/core/ajax/preview.php index f7e24e0ec28..12bc80e4037 100644 --- a/core/ajax/preview.php +++ b/core/ajax/preview.php @@ -29,13 +29,12 @@ if ($maxX === 0 || $maxY === 0) { exit; } -$preview = new \OC\Preview(\OC_User::getUser(), 'files'); - $info = \OC\Files\Filesystem::getFileInfo($file); -if (!$info instanceof OCP\Files\FileInfo || !$always && !$preview->isAvailable($info)) { +if (!$info instanceof OCP\Files\FileInfo || !$always && !\OC::$server->getPreviewManager()->isAvailable($info)) { \OC_Response::setStatus(404); } else { + $preview = new \OC\Preview(\OC_User::getUser(), 'files'); $preview->setFile($file); $preview->setMaxX($maxX); $preview->setMaxY($maxY); diff --git a/core/avatar/avatarcontroller.php b/core/avatar/avatarcontroller.php index f63e02b7761..b63c8ad53b5 100644 --- a/core/avatar/avatarcontroller.php +++ b/core/avatar/avatarcontroller.php @@ -95,7 +95,7 @@ class AvatarController extends Controller { $avatar = $this->avatarManager->getAvatar($userId); $image = $avatar->get($size); - if ($image instanceof \OC_Image) { + if ($image instanceof \OCP\IImage) { $resp = new DataDisplayResponse($image->data(), Http::STATUS_OK, ['Content-Type' => $image->mimeType()]); |