Skip to content
Snippets Groups Projects
Commit e26215a1 authored by Yassine Doghri's avatar Yassine Doghri
Browse files

fix: extract podcast ids from user groups using a regex

parent acb067a8
No related branches found
No related tags found
No related merge requests found
......@@ -183,7 +183,9 @@ if (! function_exists('get_podcast_groups')) {
$userPodcastIds = [];
// extract all podcast ids from groups
foreach ($podcastGroups as $podcastGroup) {
$userPodcastIds[] = substr((string) $podcastGroup, strpos((string) $podcastGroup, '#') + 1, 1);
// extract podcast id from group and add it to the list of ids
preg_match('~podcast#([0-9]+)-[a-z]+~', $podcastGroup, $matches);
$userPodcastIds[] = $matches[1];
}
return $userPodcastIds;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment