]> source.dussan.org Git - nextcloud-server.git/commitdiff
only call shell_exec if enabled
authorGeorg Ehrke <developer@georgehrke.com>
Thu, 17 Oct 2013 12:31:07 +0000 (14:31 +0200)
committerGeorg Ehrke <developer@georgehrke.com>
Thu, 17 Oct 2013 12:31:07 +0000 (14:31 +0200)
lib/private/preview/movies.php
lib/private/preview/office.php

index dc50d1603469a6d68ec9596d0e4fac77b5e2ea49..4d85e23c63cf1ebda94ebd3e187407f99741f1e8 100644 (file)
@@ -11,7 +11,7 @@ namespace OC\Preview;
 // movie preview is currently not supported on Windows
 if (!\OC_Util::runningOnWindows()) {
        $isShellExecEnabled = !in_array('shell_exec', explode(', ', ini_get('disable_functions')));
-       $whichAVCONV = shell_exec('which avconv');
+       $whichAVCONV = ($isShellExecEnabled ? shell_exec('which avconv') : '');
        $isAVCONVAvailable = !empty($whichAVCONV);
 
        if($isShellExecEnabled && $isAVCONVAvailable) {
index 673b16edc192ff86b026d9fe3fbe09be818c3425..5b70f5b8d583d65f7bfa4aed70035ff6a21d82fa 100644 (file)
@@ -11,9 +11,9 @@ if (extension_loaded('imagick')) {
 
        // movie preview is currently not supported on Windows
        if (!\OC_Util::runningOnWindows()) {
-               $whichLibreOffice = shell_exec('which libreoffice');
+               $whichLibreOffice = ($isShellExecEnabled ? shell_exec('which libreoffice') : '');
                $isLibreOfficeAvailable = !empty($whichLibreOffice);
-               $whichOpenOffice = shell_exec('which libreoffice');
+               $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)))) {