Browse Source

Use getenv to get the paths for `find`

tags/v8.1.0alpha1
Olivier Paroz 9 years ago
parent
commit
0f01de9f7e
1 changed files with 4 additions and 3 deletions
  1. 4
    3
      lib/private/helper.php

+ 4
- 3
lib/private/helper.php View File

@@ -925,9 +925,10 @@ class OC_Helper {
// Returns null if nothing is found
$result = $exeSniffer->find($program);
if (empty($result)) {
// The order of the folders is important as we'll use the first command we find
exec('find /usr/local/bin/ /usr/bin/ -name ' . escapeshellarg($program) . ' 2> /dev/null', $output, $returnCode);
if ($returnCode === 0 && count($output) > 0) {
$paths = str_replace(':','/ ',getenv('PATH'));
$command = 'find ' . $paths . ' -name ' . escapeshellarg($program) . ' 2> /dev/null';
exec($command, $output, $returnCode);
if (count($output) > 0) {
$result = escapeshellcmd($output[0]);
}
}

Loading…
Cancel
Save