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" }pull/5993/head
parent
113b446e1f
commit
d80d266201
|
@ -1008,7 +1008,7 @@ class RemoteFilesystem
|
||||||
// Path for a public download follows this pattern /{user}/{repo}/downloads/{whatever}
|
// Path for a public download follows this pattern /{user}/{repo}/downloads/{whatever}
|
||||||
// {@link https://blog.bitbucket.org/2009/04/12/new-feature-downloads/}
|
// {@link https://blog.bitbucket.org/2009/04/12/new-feature-downloads/}
|
||||||
$pathParts = explode('/', $path);
|
$pathParts = explode('/', $path);
|
||||||
if (count($pathParts) >= 4 && $pathParts[2] != 'downloads') {
|
if (count($pathParts) >= 4 && $pathParts[3] == 'downloads') {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue