diff --git a/src/Cache/NowPlayingCache.php b/src/Cache/NowPlayingCache.php index 2669d4d6d..17934d6e0 100644 --- a/src/Cache/NowPlayingCache.php +++ b/src/Cache/NowPlayingCache.php @@ -157,7 +157,9 @@ final class NowPlayingCache } return $this->cache->getItem( - 'now_playing.station_' . $identifier + urlencode( + 'now_playing.station_' . $identifier + ) ); } } diff --git a/src/Console/Command/Sync/SingleTaskCommand.php b/src/Console/Command/Sync/SingleTaskCommand.php index b9c76e079..d2b76588b 100644 --- a/src/Console/Command/Sync/SingleTaskCommand.php +++ b/src/Console/Command/Sync/SingleTaskCommand.php @@ -106,7 +106,7 @@ final class SingleTaskCommand extends AbstractSyncCommand */ public static function getCacheKey(string $taskClass): string { - return 'sync_last_run.' . self::getClassShortName($taskClass); + return urlencode('sync_last_run.' . self::getClassShortName($taskClass)); } /** diff --git a/src/Controller/Api/Stations/OnDemand/ListAction.php b/src/Controller/Api/Stations/OnDemand/ListAction.php index a4080be5c..7bd508b25 100644 --- a/src/Controller/Api/Stations/OnDemand/ListAction.php +++ b/src/Controller/Api/Stations/OnDemand/ListAction.php @@ -65,7 +65,11 @@ final class ListAction extends AbstractSearchableListAction private function getPlaylists( Station $station ): array { - $item = $this->psr6Cache->getItem('station_' . $station->getIdRequired() . '_on_demand_playlists'); + $item = $this->psr6Cache->getItem( + urlencode( + 'station_' . $station->getIdRequired() . '_on_demand_playlists' + ) + ); if (!$item->isHit()) { $playlistIds = $this->em->createQuery( diff --git a/src/Controller/Api/Stations/ScheduleAction.php b/src/Controller/Api/Stations/ScheduleAction.php index 74f585003..1865cd9ea 100644 --- a/src/Controller/Api/Stations/ScheduleAction.php +++ b/src/Controller/Api/Stations/ScheduleAction.php @@ -81,7 +81,7 @@ final class ScheduleAction implements SingleActionInterface . $dateRange->getStart()->format('Ymd') . '-' . $dateRange->getEnd()->format('Ymd'); - $cacheItem = $this->psr6Cache->getItem($cacheKey); + $cacheItem = $this->psr6Cache->getItem(urlencode($cacheKey)); if (!$cacheItem->isHit()) { $nowTz = CarbonImmutable::now($station->getTimezoneObject()); @@ -113,7 +113,7 @@ final class ScheduleAction implements SingleActionInterface $cacheKey = 'api_station_' . $station->getId() . '_schedule_upcoming'; } - $cacheItem = $this->psr6Cache->getItem($cacheKey); + $cacheItem = $this->psr6Cache->getItem(urlencode($cacheKey)); if (!$cacheItem->isHit()) { $cacheItem->set($this->scheduleRepo->getUpcomingSchedule($station, $now));