diff options
Diffstat (limited to 'core/ajax/preview.php')
-rw-r--r-- | core/ajax/preview.php | 5 |
1 files changed, 2 insertions, 3 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); |