summaryrefslogtreecommitdiffstats
path: root/lib/private/preview/office.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-10-15 00:15:45 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-10-15 00:15:45 +0200
commite3489b36ffe2336ff685b63126aa56d17d69b123 (patch)
tree0bb1e63fcf4b78c01087584123c09c96a8c93964 /lib/private/preview/office.php
parent86f6f0ca92cb1ea3be45ca45e9f72ec556003f58 (diff)
downloadnextcloud-server-e3489b36ffe2336ff685b63126aa56d17d69b123.tar.gz
nextcloud-server-e3489b36ffe2336ff685b63126aa56d17d69b123.zip
any preview requiring the which command will not be used on Windows
Diffstat (limited to 'lib/private/preview/office.php')
-rw-r--r--lib/private/preview/office.php25
1 files changed, 16 insertions, 9 deletions
diff --git a/lib/private/preview/office.php b/lib/private/preview/office.php
index 5287bbd6ac1..673b16edc19 100644
--- a/lib/private/preview/office.php
+++ b/lib/private/preview/office.php
@@ -8,15 +8,22 @@
//both, libreoffice backend and php fallback, need imagick
if (extension_loaded('imagick')) {
$isShellExecEnabled = !in_array('shell_exec', explode(', ', ini_get('disable_functions')));
- $whichLibreOffice = shell_exec('which libreoffice');
- $isLibreOfficeAvailable = !empty($whichLibreOffice);
- $whichOpenOffice = 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{
+
+ // movie preview is currently not supported on Windows
+ if (!\OC_Util::runningOnWindows()) {
+ $whichLibreOffice = shell_exec('which libreoffice');
+ $isLibreOfficeAvailable = !empty($whichLibreOffice);
+ $whichOpenOffice = 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');
}
-} \ No newline at end of file
+}