only call shell_exec if enabled
This commit is contained in:
parent
9c8d1190c0
commit
521277b8b6
|
@ -11,7 +11,7 @@ namespace OC\Preview;
|
||||||
// movie preview is currently not supported on Windows
|
// movie preview is currently not supported on Windows
|
||||||
if (!\OC_Util::runningOnWindows()) {
|
if (!\OC_Util::runningOnWindows()) {
|
||||||
$isShellExecEnabled = !in_array('shell_exec', explode(', ', ini_get('disable_functions')));
|
$isShellExecEnabled = !in_array('shell_exec', explode(', ', ini_get('disable_functions')));
|
||||||
$whichAVCONV = shell_exec('which avconv');
|
$whichAVCONV = ($isShellExecEnabled ? shell_exec('which avconv') : '');
|
||||||
$isAVCONVAvailable = !empty($whichAVCONV);
|
$isAVCONVAvailable = !empty($whichAVCONV);
|
||||||
|
|
||||||
if($isShellExecEnabled && $isAVCONVAvailable) {
|
if($isShellExecEnabled && $isAVCONVAvailable) {
|
||||||
|
|
|
@ -11,9 +11,9 @@ if (extension_loaded('imagick')) {
|
||||||
|
|
||||||
// movie preview is currently not supported on Windows
|
// movie preview is currently not supported on Windows
|
||||||
if (!\OC_Util::runningOnWindows()) {
|
if (!\OC_Util::runningOnWindows()) {
|
||||||
$whichLibreOffice = shell_exec('which libreoffice');
|
$whichLibreOffice = ($isShellExecEnabled ? shell_exec('which libreoffice') : '');
|
||||||
$isLibreOfficeAvailable = !empty($whichLibreOffice);
|
$isLibreOfficeAvailable = !empty($whichLibreOffice);
|
||||||
$whichOpenOffice = shell_exec('which libreoffice');
|
$whichOpenOffice = ($isShellExecEnabled ? shell_exec('which libreoffice') : '');
|
||||||
$isOpenOfficeAvailable = !empty($whichOpenOffice);
|
$isOpenOfficeAvailable = !empty($whichOpenOffice);
|
||||||
//let's see if there is libreoffice or openoffice on this machine
|
//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)))) {
|
if($isShellExecEnabled && ($isLibreOfficeAvailable || $isOpenOfficeAvailable || is_string(\OC_Config::getValue('preview_libreoffice_path', null)))) {
|
||||||
|
|
Loading…
Reference in New Issue