Merge pull request #6660 from owncloud/fixing-disabled-function-checks

Fixing disabled function checks
This commit is contained in:
Thomas Müller 2014-01-07 11:10:45 -08:00
commit b6474506eb
3 changed files with 6 additions and 4 deletions

View File

@ -858,11 +858,13 @@ class OC_Helper {
if (!function_exists($function_name)) {
return false;
}
$disabled = explode(', ', ini_get('disable_functions'));
$disabled = explode(',', ini_get('disable_functions'));
$disabled = array_map('trim', $disabled);
if (in_array($function_name, $disabled)) {
return false;
}
$disabled = explode(', ', ini_get('suhosin.executor.func.blacklist'));
$disabled = explode(',', ini_get('suhosin.executor.func.blacklist'));
$disabled = array_map('trim', $disabled);
if (in_array($function_name, $disabled)) {
return false;
}

View File

@ -18,7 +18,7 @@ function findBinaryPath($program) {
// movie preview is currently not supported on Windows
if (!\OC_Util::runningOnWindows()) {
$isExecEnabled = !in_array('exec', explode(', ', ini_get('disable_functions')));
$isExecEnabled = \OC_Helper::is_function_enabled('exec');
$ffmpegBinary = null;
$avconvBinary = null;

View File

@ -7,7 +7,7 @@
*/
//both, libreoffice backend and php fallback, need imagick
if (extension_loaded('imagick')) {
$isShellExecEnabled = !in_array('shell_exec', explode(', ', ini_get('disable_functions')));
$isShellExecEnabled = \OC_Helper::is_function_enabled('shell_exec');
// LibreOffice preview is currently not supported on Windows
if (!\OC_Util::runningOnWindows()) {