From 8a136d18e54c9dca834025569b4b2eaeda098c6d Mon Sep 17 00:00:00 2001 From: gregory Date: Wed, 11 Oct 2017 15:55:31 +0300 Subject: [PATCH] Correctly extract username/password from URL --- src/Composer/Util/RemoteFilesystem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php index f9cd89d98..bae3019a2 100644 --- a/src/Composer/Util/RemoteFilesystem.php +++ b/src/Composer/Util/RemoteFilesystem.php @@ -224,7 +224,7 @@ class RemoteFilesystem $this->redirects = 1; // The first request counts. // capture username/password from URL if there is one - if (preg_match('{^https?://(.+):(.+)@([^/]+)}i', $fileUrl, $match)) { + if (preg_match('{^https?://([^:]+):([^@]+)@([^/]+)}i', $fileUrl, $match)) { $this->io->setAuthentication($originUrl, urldecode($match[1]), urldecode($match[2])); }