1
0
Fork 0

Make github driver code more robust

pull/6598/head
Jordi Boggiano 2017-08-08 15:56:08 +02:00
parent 6be57475ac
commit 97d09a9b77
1 changed files with 2 additions and 2 deletions

View File

@ -512,8 +512,8 @@ class GitHubDriver extends VcsDriver
{ {
$headers = $this->remoteFilesystem->getLastHeaders(); $headers = $this->remoteFilesystem->getLastHeaders();
foreach ($headers as $header) { foreach ($headers as $header) {
if (substr($header, 0, 5) === 'Link:') { if (preg_match('{^link:\s*(.+?)\s*$}i', $header, $match)) {
$links = explode(',', substr($header, 5)); $links = explode(',', $match[1]);
foreach ($links as $link) { foreach ($links as $link) {
if (preg_match('{<(.+?)>; *rel="next"}', $link, $match)) { if (preg_match('{<(.+?)>; *rel="next"}', $link, $match)) {
return $match[1]; return $match[1];