Skip to content

Commit ced3a22

Browse files
committed
fix pagination regex
1 parent decac87 commit ced3a22

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/lti/LTI_Names_Roles_Provisioning_Service.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function get_members() {
3131

3232
$next_page = false;
3333
foreach($page['headers'] as $header) {
34-
if (preg_match("/^Link: ?<(.*)>; ?rel=\"next\"$/i", $header, $matches)) {
34+
if (preg_match("/^Link:.*<([^>])>; ?rel=\"next\"/i", $header, $matches)) {
3535
$next_page = $matches[1];
3636
break;
3737
}

src/lti/LTI_Service_Connector.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public function get_access_token($scopes) {
5050
curl_setopt($ch, CURLOPT_POST, 1);
5151
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($auth_request));
5252
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
53+
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
5354
$resp = curl_exec($ch);
5455
$token_data = json_decode($resp, true);
5556
curl_close ($ch);
@@ -66,6 +67,7 @@ public function make_service_request($scopes, $method, $url, $body = null, $cont
6667
curl_setopt($ch, CURLOPT_URL, $url);
6768
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
6869
curl_setopt($ch, CURLOPT_HEADER, 1);
70+
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
6971
if ($method === 'POST') {
7072
curl_setopt($ch, CURLOPT_POST, 1);
7173
curl_setopt($ch, CURLOPT_POSTFIELDS, strval($body));

0 commit comments

Comments
 (0)