X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/6e325de226fd930dae481a13ba80e002c6214a74..refs/pull/3918/head:/app/Auth/Access/GroupSyncService.php diff --git a/app/Auth/Access/GroupSyncService.php b/app/Auth/Access/GroupSyncService.php index db19b007a..37d4e02d0 100644 --- a/app/Auth/Access/GroupSyncService.php +++ b/app/Auth/Access/GroupSyncService.php @@ -28,10 +28,8 @@ class GroupSyncService */ protected function externalIdMatchesGroupNames(string $externalId, array $groupNames): bool { - $externalAuthIds = explode(',', strtolower($externalId)); - - foreach ($externalAuthIds as $externalAuthId) { - if (in_array(trim($externalAuthId), $groupNames)) { + foreach ($this->parseRoleExternalAuthId($externalId) as $externalAuthId) { + if (in_array($externalAuthId, $groupNames)) { return true; } } @@ -39,6 +37,18 @@ class GroupSyncService return false; } + protected function parseRoleExternalAuthId(string $externalId): array + { + $inputIds = preg_split('/(?