Skip to content
Snippets Groups Projects
Commit ff289c1f authored by Thomas Kiehne's avatar Thomas Kiehne
Browse files

#3220682 Pagination fix

parent c60305e0
No related branches found
No related tags found
No related merge requests found
......@@ -78,7 +78,7 @@ class Canvas {
// We use a counter as a failsafe to this becoming an infinite loop.
$i = 0;
while($next){
$response = $this->client->get($next);
$response = drupal_http_request($next, $options);
$data = array_merge($data,json_decode($response->data,TRUE));
$next = $this->_getNextURL($response);
$i++;
......@@ -121,8 +121,7 @@ class Canvas {
*/
private function _getNextURL($response){
if(isset($response->headers['link'])){
$linkHeader = $response->headers['link'];
$link = reset($linkHeader);
$link = $response->headers['link'];
$matches = [];
$pattern = '/,<(.+)>; rel="next"/';
preg_match($pattern, $link, $matches);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment