mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-03 23:09:18 +02:00
fix: extract podcast ids from user groups using a regex
This commit is contained in:
parent
acb067a80e
commit
e26215a11f
1 changed files with 3 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue