Sfoglia il codice sorgente

Avoid transforming the origins when prompting for auth, fixes #8300

Jordi Boggiano 5 anni fa
parent
commit
f0d565bb6d
2 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 1 1
      src/Composer/Util/Git.php
  2. 1 1
      src/Composer/Util/RemoteFilesystem.php

+ 1 - 1
src/Composer/Util/Git.php

@@ -193,7 +193,7 @@ class Git
                         }
                     }
 
-                    $this->io->writeError('    Authentication required (<info>' . parse_url($url, PHP_URL_HOST) . '</info>):');
+                    $this->io->writeError('    Authentication required (<info>' . $match[2] . '</info>):');
                     $auth = array(
                         'username' => $this->io->ask('      Username: ', $defaultUsername),
                         'password' => $this->io->askAndHideAnswer('      Password: '),

+ 1 - 1
src/Composer/Util/RemoteFilesystem.php

@@ -745,7 +745,7 @@ class RemoteFilesystem
                 throw new TransportException("Invalid credentials for '" . $this->fileUrl . "', aborting.", $httpStatus);
             }
 
-            $this->io->writeError('    Authentication required (<info>'.parse_url($this->fileUrl, PHP_URL_HOST).'</info>):');
+            $this->io->writeError('    Authentication required (<info>'.$this->originUrl.'</info>):');
             $username = $this->io->ask('      Username: ');
             $password = $this->io->askAndHideAnswer('      Password: ');
             $this->io->setAuthentication($this->originUrl, $username, $password);