1
0
Fork 0

Merge branch '1.1'

pull/5359/head
Jordi Boggiano 2016-05-17 23:02:40 +01:00
commit e2c3bc5e89
1 changed files with 4 additions and 1 deletions

View File

@ -233,7 +233,10 @@ class RemoteFilesystem
$origFileUrl = $fileUrl;
if (isset($options['github-token'])) {
$fileUrl .= (false === strpos($fileUrl, '?') ? '?' : '&') . 'access_token='.$options['github-token'];
// only add the access_token if it is actually a github URL (in case we were redirected to S3)
if (preg_match('{^https?://([a-z0-9-]+\.)*github\.com/}', $fileUrl)) {
$fileUrl .= (false === strpos($fileUrl, '?') ? '?' : '&') . 'access_token='.$options['github-token'];
}
unset($options['github-token']);
}