Skip to content

Commit

Permalink
Fix TypeError in CanvasApi (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
spvickers committed Oct 3, 2024
1 parent 3aaa85c commit b5a4bc1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ApiHook/canvas/CanvasApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private function setGroupSets(string $perPage, string $prefix): bool
];
}
}
if (preg_match('/\<([^\>]+)\>; *rel=\"next\"/', $http->responseHeaders, $matches)) {
if (preg_match('/\<([^\>]+)\>; *rel=\"next\"/', implode("\n", $http->responseHeaders), $matches)) {
$url = $matches[1];
}
}
Expand Down Expand Up @@ -161,7 +161,7 @@ private function getRoles(string $perPage): array|bool
foreach ($enrolments as $enrolment) {
$roles[strval($enrolment->user_id)] = $enrolment->type;
}
if (preg_match('/\<([^\>]+)\>; *rel=\"next\"/', $http->responseHeaders, $matches)) {
if (preg_match('/\<([^\>]+)\>; *rel=\"next\"/', implode("\n", $http->responseHeaders), $matches)) {
$url = $matches[1];
}
} else {
Expand Down Expand Up @@ -243,7 +243,7 @@ private function getUsers(string $perPage, bool $withGroups): array|bool
}
$users[$userId] = $user;
}
if (preg_match('/\<([^\>]+)\>; *rel=\"next\"/', $http->responseHeaders, $matches)) {
if (preg_match('/\<([^\>]+)\>; *rel=\"next\"/', implode("\n", $http->responseHeaders), $matches)) {
$url = $matches[1];
}
} else {
Expand Down Expand Up @@ -302,7 +302,7 @@ private function setGroups(string $perPage, array $users): bool
}
}
}
if (preg_match('/\<([^\>]+)\>; *rel=\"next\"/', $http->responseHeaders, $matches)) {
if (preg_match('/\<([^\>]+)\>; *rel=\"next\"/', implode("\n", $http->responseHeaders), $matches)) {
$url = $matches[1];
}
}
Expand Down

0 comments on commit b5a4bc1

Please sign in to comment.