Loading modules/Auth/Controllers/ContributorController.php +1 −1 Original line number Diff line number Diff line Loading @@ -228,7 +228,7 @@ class ContributorController extends BaseController ->delete("podcast#{$this->podcast->id}_contributors"); // remove contributor from podcast group $this->contributor->removeGroup(get_podcast_group($this->contributor, $this->podcast->id)); $this->contributor->removeGroup(get_podcast_group($this->contributor, $this->podcast->id, false)); return redirect() ->route('contributor-list', [$this->podcast->id]) Loading modules/Auth/Helpers/auth_helper.php +8 −4 Original line number Diff line number Diff line Loading @@ -136,7 +136,7 @@ if (! function_exists('set_instance_group')) { } if (! function_exists('get_podcast_group')) { function get_podcast_group(User $user, int $podcastId): ?string function get_podcast_group(User $user, int $podcastId, bool $removePrefix = true): ?string { $podcastGroups = array_filter($user->getGroups() ?? [], static function ($group) use ($podcastId): bool { return str_starts_with($group, "podcast#{$podcastId}"); Loading @@ -154,9 +154,13 @@ if (! function_exists('get_podcast_group')) { $user->removeGroup(...$podcastGroups); } if ($removePrefix) { // strip the `podcast#{id}.` prefix when returning group return substr((string) $podcastGroup, strlen('podcast#' . $podcastId . '-')); } return $podcastGroup; } } if (! function_exists('set_podcast_group')) { Loading Loading @@ -184,7 +188,7 @@ if (! function_exists('get_podcast_groups')) { // extract all podcast ids from groups foreach ($podcastGroups as $podcastGroup) { // extract podcast id from group and add it to the list of ids preg_match('~podcast#([0-9]+)-[a-z]+~', $podcastGroup, $matches); preg_match('~podcast#(\d+)-[a-z]+~', (string) $podcastGroup, $matches); $userPodcastIds[] = $matches[1]; } Loading Loading
modules/Auth/Controllers/ContributorController.php +1 −1 Original line number Diff line number Diff line Loading @@ -228,7 +228,7 @@ class ContributorController extends BaseController ->delete("podcast#{$this->podcast->id}_contributors"); // remove contributor from podcast group $this->contributor->removeGroup(get_podcast_group($this->contributor, $this->podcast->id)); $this->contributor->removeGroup(get_podcast_group($this->contributor, $this->podcast->id, false)); return redirect() ->route('contributor-list', [$this->podcast->id]) Loading
modules/Auth/Helpers/auth_helper.php +8 −4 Original line number Diff line number Diff line Loading @@ -136,7 +136,7 @@ if (! function_exists('set_instance_group')) { } if (! function_exists('get_podcast_group')) { function get_podcast_group(User $user, int $podcastId): ?string function get_podcast_group(User $user, int $podcastId, bool $removePrefix = true): ?string { $podcastGroups = array_filter($user->getGroups() ?? [], static function ($group) use ($podcastId): bool { return str_starts_with($group, "podcast#{$podcastId}"); Loading @@ -154,9 +154,13 @@ if (! function_exists('get_podcast_group')) { $user->removeGroup(...$podcastGroups); } if ($removePrefix) { // strip the `podcast#{id}.` prefix when returning group return substr((string) $podcastGroup, strlen('podcast#' . $podcastId . '-')); } return $podcastGroup; } } if (! function_exists('set_podcast_group')) { Loading Loading @@ -184,7 +188,7 @@ if (! function_exists('get_podcast_groups')) { // extract all podcast ids from groups foreach ($podcastGroups as $podcastGroup) { // extract podcast id from group and add it to the list of ids preg_match('~podcast#([0-9]+)-[a-z]+~', $podcastGroup, $matches); preg_match('~podcast#(\d+)-[a-z]+~', (string) $podcastGroup, $matches); $userPodcastIds[] = $matches[1]; } Loading