From e491b72a8c96e0595ca389b098132fa5272b141e Mon Sep 17 00:00:00 2001 From: Rob Bast Date: Mon, 28 Sep 2015 10:38:16 +0200 Subject: [PATCH 1/2] only urlencode $ if filename is not local --- src/Composer/Repository/ComposerRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Repository/ComposerRepository.php b/src/Composer/Repository/ComposerRepository.php index f3b0642d0..5abe328ae 100644 --- a/src/Composer/Repository/ComposerRepository.php +++ b/src/Composer/Repository/ComposerRepository.php @@ -585,7 +585,7 @@ class ComposerRepository extends ArrayRepository } // url-encode $ signs in URLs as bad proxies choke on them - if ($pos = strpos($filename, '$')) { + if ($pos = strpos($filename, '$') && preg_match('{^https?://.*}i', $filename)) { $filename = substr($filename, 0, $pos) . '%24' . substr($filename, $pos+1); } From b219abe8f634675ea62722ec2b2dcb525059f3ac Mon Sep 17 00:00:00 2001 From: Rob Bast Date: Mon, 28 Sep 2015 10:59:26 +0200 Subject: [PATCH 2/2] @seldaek damn your assignment in expression --- src/Composer/Repository/ComposerRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Repository/ComposerRepository.php b/src/Composer/Repository/ComposerRepository.php index 5abe328ae..2fce1e336 100644 --- a/src/Composer/Repository/ComposerRepository.php +++ b/src/Composer/Repository/ComposerRepository.php @@ -585,7 +585,7 @@ class ComposerRepository extends ArrayRepository } // url-encode $ signs in URLs as bad proxies choke on them - if ($pos = strpos($filename, '$') && preg_match('{^https?://.*}i', $filename)) { + if (($pos = strpos($filename, '$')) && preg_match('{^https?://.*}i', $filename)) { $filename = substr($filename, 0, $pos) . '%24' . substr($filename, $pos+1); }