Security update for Core, with self-updated composer
[yaffs-website] / vendor / drush / drush / includes / startup.inc
index 378edbd81b5838645d4776960bcc2c6b1373e1c3..ea3a4b11f321300302c1cd75c2f3731ac196c601 100644 (file)
@@ -129,7 +129,11 @@ function find_wrapper_or_launcher_at_location($location) {
  * Determine whether current OS is a Windows variant.
  */
 function drush_is_windows($os = NULL) {
-  return strtoupper(substr($os ?: PHP_OS, 0, 3)) === 'WIN';
+  // The _drush_get_os() function may not be available, so resolve "LOCAL"
+  if (!$os || $os == "LOCAL") {
+    $os = PHP_OS;
+  }
+  return strtoupper(substr($os, 0, 3)) === 'WIN';
 }
 
 function drush_escapeshellarg($arg, $os = NULL, $raw = FALSE) {
@@ -383,7 +387,7 @@ function drush_startup($argv) {
   }
 
   // Always use pcntl_exec if it exists.
-  $use_pcntl_exec = function_exists("pcntl_exec");
+  $use_pcntl_exec = function_exists("pcntl_exec") && (strpos(ini_get('disable_functions'), 'pcntl_exec') === FALSE);
 
   // If we have posix_getppid, then pass in the shell pid so
   // that 'site-set' et. al. can work correctly.