summaryrefslogtreecommitdiffstats
path: root/lib/private/preview/office.php
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2014-03-05 15:53:12 +0100
committerGeorg Ehrke <developer@georgehrke.com>2014-03-05 15:57:45 +0100
commitdbf83aada2f8dae509d17b947ecce6a4d09f8174 (patch)
treeb4133b424f49619e395947901f39cc29094c3b18 /lib/private/preview/office.php
parent37d22bf170708a3f6b9395fb6afe25c255e91a9a (diff)
downloadnextcloud-server-dbf83aada2f8dae509d17b947ecce6a4d09f8174.tar.gz
nextcloud-server-dbf83aada2f8dae509d17b947ecce6a4d09f8174.zip
fix issue with Non-static method Imagick ../..; @ doesn't seem to work in this case
Diffstat (limited to 'lib/private/preview/office.php')
-rw-r--r--lib/private/preview/office.php35
1 files changed, 20 insertions, 15 deletions
diff --git a/lib/private/preview/office.php b/lib/private/preview/office.php
index 02bb22e9b94..269e1dad74e 100644
--- a/lib/private/preview/office.php
+++ b/lib/private/preview/office.php
@@ -6,24 +6,29 @@
* See the COPYING-README file.
*/
//both, libreoffice backend and php fallback, need imagick
-if (extension_loaded('imagick') && count(@\Imagick::queryFormats("PDF")) === 1) {
- $isShellExecEnabled = \OC_Helper::is_function_enabled('shell_exec');
+if (extension_loaded('imagick')) {
- // LibreOffice preview is currently not supported on Windows
- if (!\OC_Util::runningOnWindows()) {
- $whichLibreOffice = ($isShellExecEnabled ? shell_exec('which libreoffice') : '');
- $isLibreOfficeAvailable = !empty($whichLibreOffice);
- $whichOpenOffice = ($isShellExecEnabled ? shell_exec('which libreoffice') : '');
- $isOpenOfficeAvailable = !empty($whichOpenOffice);
- //let's see if there is libreoffice or openoffice on this machine
- if($isShellExecEnabled && ($isLibreOfficeAvailable || $isOpenOfficeAvailable || is_string(\OC_Config::getValue('preview_libreoffice_path', null)))) {
- require_once('office-cl.php');
- }else{
+ $checkImagick = new Imagick();
+
+ if(count($checkImagick->queryFormats('PDF')) === 1) {
+ $isShellExecEnabled = \OC_Helper::is_function_enabled('shell_exec');
+
+ // LibreOffice preview is currently not supported on Windows
+ if (!\OC_Util::runningOnWindows()) {
+ $whichLibreOffice = ($isShellExecEnabled ? shell_exec('which libreoffice') : '');
+ $isLibreOfficeAvailable = !empty($whichLibreOffice);
+ $whichOpenOffice = ($isShellExecEnabled ? shell_exec('which libreoffice') : '');
+ $isOpenOfficeAvailable = !empty($whichOpenOffice);
+ //let's see if there is libreoffice or openoffice on this machine
+ if($isShellExecEnabled && ($isLibreOfficeAvailable || $isOpenOfficeAvailable || is_string(\OC_Config::getValue('preview_libreoffice_path', null)))) {
+ require_once('office-cl.php');
+ }else{
+ //in case there isn't, use our fallback
+ require_once('office-fallback.php');
+ }
+ } else {
//in case there isn't, use our fallback
require_once('office-fallback.php');
}
- } else {
- //in case there isn't, use our fallback
- require_once('office-fallback.php');
}
}