Browse Source

Fix the replacement of the credentials.

://username:password@domain
was replaced by ://://:***@domain
instead of ://username:***@domain or ://***:***@domain
Stefan Grootscholten 8 years ago
parent
commit
42f4d344a4
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/Composer/Util/ProcessExecutor.php

+ 2 - 2
src/Composer/Util/ProcessExecutor.php

@@ -45,11 +45,11 @@ class ProcessExecutor
     {
         if ($this->io && $this->io->isDebug()) {
             $safeCommand = preg_replace_callback('{(://)(?P<user>[^:/\s]+):(?P<password>[^@\s/]+)}i', function ($m) {
-                if (preg_match('{^[a-f0-9]{12,}$}', $m[1])) {
+                if (preg_match('{^[a-f0-9]{12,}$}', $m[2])) {
                     return '://***:***';
                 }
 
-                return '://'.$m[1].':***';
+                return '://'.$m[2].':***';
             }, $command);
             $this->io->writeError('Executing command ('.($cwd ?: 'CWD').'): '.$safeCommand);
         }