Security update for Core, with self-updated composer
[yaffs-website] / vendor / drush / drush / includes / environment.inc
index 5fdfc472b69beb1f6abddaa18388f5582361e4ae..00822078287749eb499690a0fc0719c3df80e598 100644 (file)
@@ -498,10 +498,11 @@ function drush_build_drush_command($drush_path = NULL, $php = NULL, $os = NULL,
 
   // Add environmental variables, if present
   if (!empty($environment_variables)) {
-    $prefix .= ' env';
+    $env = 'env';
     foreach ($environment_variables as $key=>$value) {
-      $prefix .= ' ' . drush_escapeshellarg($key, $os) . '=' . drush_escapeshellarg($value, $os);
+      $env .= ' ' . drush_escapeshellarg($key, $os) . '=' . drush_escapeshellarg($value, $os);
     }
+    $prefix = $env . ' ' . $prefix;
   }
 
   return trim($prefix . ' ' . drush_escapeshellarg($drush_path, $os) . $additional_options);