Skip to content
Snippets Groups Projects
Commit e0af42d1 authored by Morris Jobke's avatar Morris Jobke
Browse files

Merge pull request #5389 from owncloud/fix_shell_exec

only call shell_exec if enabled
parents 01349850 4c5959e1
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
......@@ -9,11 +9,11 @@
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 = 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)))) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment