aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-04-15 00:16:56 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-04-15 00:16:56 +0200
commit70480423ffa6e7d469141c3022e53ea151856bd0 (patch)
tree6360d8506774c7f59dbbe7a3ce792e19c713808e
parent1aa368effea00b7534bfee2f12835d4c93e5f6f1 (diff)
parentbb0c09e994869b216b8163d262ffc7db9d439221 (diff)
downloadnextcloud-server-70480423ffa6e7d469141c3022e53ea151856bd0.tar.gz
nextcloud-server-70480423ffa6e7d469141c3022e53ea151856bd0.zip
Merge pull request #15597 from oparoz/another-fallback-for-findbinarypath
Adding a final fallback for findBinaryPath
-rw-r--r--lib/private/helper.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/helper.php b/lib/private/helper.php
index cb95dd49beb..11311d7c55f 100644
--- a/lib/private/helper.php
+++ b/lib/private/helper.php
@@ -931,7 +931,12 @@ class OC_Helper {
// Returns null if nothing is found
$result = $exeSniffer->find($program);
if (empty($result)) {
- $paths = str_replace(':','/ ',getenv('PATH'));
+ $paths = getenv('PATH');
+ if (empty($paths)) {
+ $paths = '/usr/local/bin /usr/bin /opt/bin /bin';
+ } else {
+ $paths = str_replace(':',' ',getenv('PATH'));
+ }
$command = 'find ' . $paths . ' -name ' . escapeshellarg($program) . ' 2> /dev/null';
exec($command, $output, $returnCode);
if (count($output) > 0) {