Commit 70480423 authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #15597 from oparoz/another-fallback-for-findbinarypath

Adding a final fallback for findBinaryPath
parents 1aa368ef bb0c09e9
......@@ -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) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment