installer: Don't shell out if it's disabled

Bug: T191947
Change-Id: I16a82d271157cd0024aa14d7eaec80b4870947b5
This commit is contained in:
Kunal Mehta 2018-05-15 11:23:38 -07:00
parent f87db68a3e
commit 2e473413a8
2 changed files with 9 additions and 0 deletions

View file

@ -990,6 +990,10 @@ abstract class Installer {
return true;
}
if ( Shell::isDisabled() ) {
return true;
}
# Get a list of available locales.
$result = Shell::command( '/usr/bin/locale', '-a' )
->execute();

View file

@ -94,6 +94,11 @@ class ExecutableFinder {
* @return bool|string
*/
public static function findInDefaultPaths( $names, $versionInfo = false ) {
if ( Shell::isDisabled() ) {
// If we can't shell out, there's no point looking for executables
return false;
}
$paths = self::getPossibleBinPaths();
foreach ( (array)$names as $name ) {
foreach ( $paths as $path ) {