From f0d565bb6d354331cadf12712b4f6e8ebbaf51a6 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 30 Aug 2019 17:52:08 +0200 Subject: [PATCH] Avoid transforming the origins when prompting for auth, fixes #8300 --- src/Composer/Util/Git.php | 2 +- src/Composer/Util/RemoteFilesystem.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Util/Git.php b/src/Composer/Util/Git.php index 74e5c286f..20457d708 100644 --- a/src/Composer/Util/Git.php +++ b/src/Composer/Util/Git.php @@ -193,7 +193,7 @@ class Git } } - $this->io->writeError(' Authentication required (' . parse_url($url, PHP_URL_HOST) . '):'); + $this->io->writeError(' Authentication required (' . $match[2] . '):'); $auth = array( 'username' => $this->io->ask(' Username: ', $defaultUsername), 'password' => $this->io->askAndHideAnswer(' Password: '), diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php index a44d8f86f..b3f51aae5 100644 --- a/src/Composer/Util/RemoteFilesystem.php +++ b/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 ('.parse_url($this->fileUrl, PHP_URL_HOST).'):'); + $this->io->writeError(' Authentication required ('.$this->originUrl.'):'); $username = $this->io->ask(' Username: '); $password = $this->io->askAndHideAnswer(' Password: '); $this->io->setAuthentication($this->originUrl, $username, $password);