From: Kunal Mehta Date: Tue, 15 May 2018 18:23:38 +0000 (-0700) Subject: installer: Don't shell out if it's disabled X-Git-Tag: 1.34.0-rc.0~5427^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=2e473413a8fd1e205142b5c5980addb34aaf369f installer: Don't shell out if it's disabled Bug: T191947 Change-Id: I16a82d271157cd0024aa14d7eaec80b4870947b5 --- diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 1efe5d6373..911e5d203b 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -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(); diff --git a/includes/utils/ExecutableFinder.php b/includes/utils/ExecutableFinder.php index 9679bfeeec..78b3f8e29b 100644 --- a/includes/utils/ExecutableFinder.php +++ b/includes/utils/ExecutableFinder.php @@ -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 ) {