Merge pull request #10022 from owncloud/fix-exec-admin-master

only call exec() if allowed to
This commit is contained in:
Thomas Müller 2014-07-29 21:28:52 +02:00
commit a779878657
1 changed files with 5 additions and 3 deletions

View File

@ -101,9 +101,11 @@ $tmpl->printPage();
* @return null|string
*/
function findBinaryPath($program) {
exec('command -v ' . escapeshellarg($program) . ' 2> /dev/null', $output, $returnCode);
if ($returnCode === 0 && count($output) > 0) {
return escapeshellcmd($output[0]);
if (OC_Helper::is_function_enabled('exec')) {
exec('command -v ' . escapeshellarg($program) . ' 2> /dev/null', $output, $returnCode);
if ($returnCode === 0 && count($output) > 0) {
return escapeshellcmd($output[0]);
}
}
return null;
}