aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/ajax
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-09-09 10:58:52 +0200
committerMorris Jobke <hey@morrisjobke.de>2016-09-09 13:53:06 +0200
commitf56ae37e8fe31afb109889816273c21704361f15 (patch)
tree8fd7cd8dd480d36d1e41184b3a1c4cc43712d7fe /apps/files_trashbin/ajax
parentf5aafdc89789623e72f9a05ecc2629ed2894668b (diff)
downloadnextcloud-server-f56ae37e8fe31afb109889816273c21704361f15.tar.gz
nextcloud-server-f56ae37e8fe31afb109889816273c21704361f15.zip
Opening the trashbin causes errors in log for files without preview
* put a file without a generated preview in the trashbin (e.g. a *.docx file) * open the trashbin * following errors will show up in the nextcloud.log: - filesize(): stat failed for ... - fopen(...): failed to open stream: No such file or directory at ... - fread() expects parameter 1 to be resource, boolean given at ... - fclose() expects parameter 1 to be resource, boolean given at ... - imagecreatefromstring(): Empty string or invalid image at ... This is because the preview code tries to load an SVG image, which is obviously only text. The fix simply handles this before the loading happens and the web UI keeps showing the default mimetype icon.
Diffstat (limited to 'apps/files_trashbin/ajax')
-rw-r--r--apps/files_trashbin/ajax/preview.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/files_trashbin/ajax/preview.php b/apps/files_trashbin/ajax/preview.php
index 1a0131da28c..3f895161f00 100644
--- a/apps/files_trashbin/ajax/preview.php
+++ b/apps/files_trashbin/ajax/preview.php
@@ -72,6 +72,8 @@ try{
$preview->setScalingUp($scalingUp);
$preview->showPreview();
+} catch (\OC\PreviewNotAvailableException $e) {
+ \OC_Response::setStatus(404);
}catch(\Exception $e) {
\OC_Response::setStatus(500);
\OCP\Util::writeLog('core', $e->getmessage(), \OCP\Util::DEBUG);