From d80d2662013607b581503af88d0dbd9cb4fdf20b Mon Sep 17 00:00:00 2001 From: Stefan Grootscholten Date: Sat, 24 Dec 2016 21:10:12 +0100 Subject: [PATCH] Fix dist download from bitbucket. URL https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 results in the following $pathParts: array(5) { [0]=> string(0) "" [1]=> string(5) "ariya" [2]=> string(9) "phantomjs" [3]=> string(9) "downloads" [4]=> string(36) "phantomjs-2.1.1-linux-x86_64.tar.bz2" } A dist download URL is like: https://bitbucket.org/user/repo/get/[git-hash].zip array(5) { [0]=> string(0) "" [1]=> string(4) "user" [2]=> string(4) "repo" [3]=> string(3) "get" [4]=> string(14) "[git-hash].zip" } --- 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 f482c91b9..5b137686d 100644 --- a/src/Composer/Util/RemoteFilesystem.php +++ b/src/Composer/Util/RemoteFilesystem.php @@ -1008,7 +1008,7 @@ class RemoteFilesystem // Path for a public download follows this pattern /{user}/{repo}/downloads/{whatever} // {@link https://blog.bitbucket.org/2009/04/12/new-feature-downloads/} $pathParts = explode('/', $path); - if (count($pathParts) >= 4 && $pathParts[2] != 'downloads') { + if (count($pathParts) >= 4 && $pathParts[3] == 'downloads') { return true; }