diff options
author | Morris Jobke <hey@morrisjobke.de> | 2016-09-09 10:58:52 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2016-09-09 13:53:06 +0200 |
commit | f56ae37e8fe31afb109889816273c21704361f15 (patch) | |
tree | 8fd7cd8dd480d36d1e41184b3a1c4cc43712d7fe /lib/private/PreviewNotAvailableException.php | |
parent | f5aafdc89789623e72f9a05ecc2629ed2894668b (diff) | |
download | nextcloud-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 'lib/private/PreviewNotAvailableException.php')
-rw-r--r-- | lib/private/PreviewNotAvailableException.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/private/PreviewNotAvailableException.php b/lib/private/PreviewNotAvailableException.php new file mode 100644 index 00000000000..7d92e860629 --- /dev/null +++ b/lib/private/PreviewNotAvailableException.php @@ -0,0 +1,27 @@ +<?php +/** + * @copyright Copyright (c) 2016 Morris Jobke <hey@morrisjobke.de> + * + * @author Morris Jobke <hey@morrisjobke.de> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +namespace OC; + +class PreviewNotAvailableException extends \Exception { +} |