summaryrefslogtreecommitdiffstats
path: root/core/ajax
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-03-11 17:08:25 +0100
committerJoas Schilling <nickvergessen@owncloud.com>2015-03-16 12:44:10 +0100
commit4c4c0fa12066b9dace5d9689836fe4a70141a2d9 (patch)
tree65ac1c648c0fa48f4a5c79885e373375d7b94cfb /core/ajax
parent1075914f8ab8f5f4c20ab7f0b9ce35e9a9e2ffe1 (diff)
downloadnextcloud-server-4c4c0fa12066b9dace5d9689836fe4a70141a2d9.tar.gz
nextcloud-server-4c4c0fa12066b9dace5d9689836fe4a70141a2d9.zip
Use the PreviewManager where possible
Diffstat (limited to 'core/ajax')
-rw-r--r--core/ajax/preview.php5
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);