From 2486771b5dbf63f74bdf32844a404a1f85941245 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Tue, 15 May 2018 11:23:38 -0700 Subject: [PATCH] installer: Don't shell out if it's disabled Bug: T191947 Change-Id: I16a82d271157cd0024aa14d7eaec80b4870947b5 (cherry picked from commit 2e473413a8fd1e205142b5c5980addb34aaf369f) --- includes/installer/Installer.php | 4 ++++ includes/utils/ExecutableFinder.php | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index aa9cd494b2..4b6e8ccd48 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 ) { -- 2.20.1