diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-08-16 10:45:51 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-08-17 20:51:35 +0200 |
commit | 5b103744c8b480a47a8973079280b3cc078714f2 (patch) | |
tree | eacc31ace30bfd355b0795cb9d2218c53a2572a0 /lib/private/Preview/Generator.php | |
parent | bcc1a53f05a8442ff1a8a5f06c585470aa44f521 (diff) | |
download | nextcloud-server-5b103744c8b480a47a8973079280b3cc078714f2.tar.gz nextcloud-server-5b103744c8b480a47a8973079280b3cc078714f2.zip |
Check if a preview provider is available before using it
Else if a preview provider is registerd but not available (for example
missing support in some external lib). It will do :boom:. This way the
providers can at least do the sanity checks required.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Preview/Generator.php')
-rw-r--r-- | lib/private/Preview/Generator.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/Preview/Generator.php b/lib/private/Preview/Generator.php index 3e81004c8aa..86579e3480b 100644 --- a/lib/private/Preview/Generator.php +++ b/lib/private/Preview/Generator.php @@ -184,6 +184,10 @@ class Generator { continue; } + if (!$provider->isAvailable($file)) { + continue; + } + $maxWidth = (int)$this->config->getSystemValue('preview_max_x', 4096); $maxHeight = (int)$this->config->getSystemValue('preview_max_y', 4096); |