From 673a8bb2b862867c7e6b8a2e1f10253a4d8f9c5f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20M=C3=BCller?= <thomas.mueller@tmit.eu>
Date: Tue, 29 Jul 2014 16:59:40 +0200
Subject: [PATCH] only call exec() if allowed to

---
 settings/admin.php | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/settings/admin.php b/settings/admin.php
index 704f4519ff..dd5f969fa1 100755
--- a/settings/admin.php
+++ b/settings/admin.php
@@ -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;
 }
-- 
GitLab