Skip to content

Commit b124206

Browse files
committed
move regx to constant
1 parent 5ee80e2 commit b124206

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-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(LTI_Service_Connector::NEXT_PAGE_REGEX, $header, $matches)) {
3535
$next_page = $matches[1];
3636
break;
3737
}

src/lti/LTI_Service_Connector.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
use Firebase\JWT\JWT;
55

66
class LTI_Service_Connector {
7+
8+
const NEXT_PAGE_REGEX = "/^Link:.*<([^>]*)>; ?rel=\"next\"/i";
9+
710
private $registration;
811
private $access_tokens = [];
912

0 commit comments

Comments
 (0)