diff options
author | Joas Schilling <coding@schilljs.com> | 2016-08-26 16:51:18 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-08-29 11:58:57 +0300 |
commit | f41c8c00894ebd687e60731e673140c8f5bda320 (patch) | |
tree | 8289247484603e0170529eca6edb168daf3788f3 /core/ajax | |
parent | 3647fbe7cd86e743b059889d69b03fcf8207780f (diff) |
Check if the file isReadable() before sending a (cached) preview
Diffstat (limited to 'core/ajax')
-rw-r--r-- | core/ajax/preview.php | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/ajax/preview.php b/core/ajax/preview.php index 2894efdc8e3..6cfba6aef30 100644 --- a/core/ajax/preview.php +++ b/core/ajax/preview.php @@ -53,6 +53,8 @@ $info = \OC\Files\Filesystem::getFileInfo($file); if (!$info instanceof OCP\Files\FileInfo || !$always && !\OC::$server->getPreviewManager()->isAvailable($info)) { \OC_Response::setStatus(404); +} else if (!$info->isReadable()) { + \OC_Response::setStatus(403); } else { $preview = new \OC\Preview(\OC_User::getUser(), 'files'); $preview->setFile($file, $info); |