From 521277b8b642ee67c7f89682a6bead2faad41c72 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Thu, 17 Oct 2013 14:31:07 +0200 Subject: [PATCH 1/2] only call shell_exec if enabled --- lib/private/preview/movies.php | 2 +- lib/private/preview/office.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/private/preview/movies.php b/lib/private/preview/movies.php index dc50d16034..4d85e23c63 100644 --- a/lib/private/preview/movies.php +++ b/lib/private/preview/movies.php @@ -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) { diff --git a/lib/private/preview/office.php b/lib/private/preview/office.php index 673b16edc1..5b70f5b8d5 100644 --- a/lib/private/preview/office.php +++ b/lib/private/preview/office.php @@ -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)))) { From 4c5959e1f5c307b199e274f6efb5680360ad5040 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Thu, 17 Oct 2013 15:19:15 +0200 Subject: [PATCH 2/2] fix comment --- lib/private/preview/office.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/preview/office.php b/lib/private/preview/office.php index 5b70f5b8d5..318ab51f85 100644 --- a/lib/private/preview/office.php +++ b/lib/private/preview/office.php @@ -9,7 +9,7 @@ if (extension_loaded('imagick')) { $isShellExecEnabled = !in_array('shell_exec', explode(', ', ini_get('disable_functions'))); - // movie preview is currently not supported on Windows + // LibreOffice preview is currently not supported on Windows if (!\OC_Util::runningOnWindows()) { $whichLibreOffice = ($isShellExecEnabled ? shell_exec('which libreoffice') : ''); $isLibreOfficeAvailable = !empty($whichLibreOffice);