diff --git a/src/Composer/Util/Git.php b/src/Composer/Util/Git.php index 86da5bdf0..37410eecd 100644 --- a/src/Composer/Util/Git.php +++ b/src/Composer/Util/Git.php @@ -57,7 +57,7 @@ class Git // capture username/password from URL if there is one $this->process->execute('git remote -v', $output, $cwd); if (preg_match('{^(?:composer|origin)\s+https?://(.+):(.+)@([^/]+)}im', $output, $match)) { - $this->io->setAuthentication($match[3], urldecode($match[1]), urldecode($match[2])); + $this->io->setAuthentication($match[3], rawurldecode($match[1]), rawurldecode($match[2])); } } diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php index 80d6ecc32..a12efe774 100644 --- a/src/Composer/Util/RemoteFilesystem.php +++ b/src/Composer/Util/RemoteFilesystem.php @@ -243,7 +243,7 @@ class RemoteFilesystem // capture username/password from URL if there is one if (preg_match('{^https?://([^:/]+):([^@/]+)@([^/]+)}i', $fileUrl, $match)) { - $this->io->setAuthentication($originUrl, urldecode($match[1]), urldecode($match[2])); + $this->io->setAuthentication($originUrl, rawurldecode($match[1]), rawurldecode($match[2])); } $tempAdditionalOptions = $additionalOptions; diff --git a/src/Composer/Util/StreamContextFactory.php b/src/Composer/Util/StreamContextFactory.php index 6b16c8a18..f5f12d315 100644 --- a/src/Composer/Util/StreamContextFactory.php +++ b/src/Composer/Util/StreamContextFactory.php @@ -109,9 +109,9 @@ final class StreamContextFactory // handle proxy auth if present if (isset($proxy['user'])) { - $auth = urldecode($proxy['user']); + $auth = rawurldecode($proxy['user']); if (isset($proxy['pass'])) { - $auth .= ':' . urldecode($proxy['pass']); + $auth .= ':' . rawurldecode($proxy['pass']); } $auth = base64_encode($auth);