installer: Don't shell out if it's disabled
authorKunal Mehta <legoktm@member.fsf.org>
Tue, 15 May 2018 18:23:38 +0000 (11:23 -0700)
committerPaladox <thomasmulhall410@yahoo.com>
Tue, 15 May 2018 20:37:53 +0000 (20:37 +0000)
Bug: T191947
Change-Id: I16a82d271157cd0024aa14d7eaec80b4870947b5
(cherry picked from commit 2e473413a8fd1e205142b5c5980addb34aaf369f)

includes/installer/Installer.php
includes/utils/ExecutableFinder.php

index aa9cd49..4b6e8cc 100644 (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();
index 9679bfe..78b3f8e 100644 (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 ) {