Merge pull request #18 from JonOfUs/main

Correct faulty timestamp check in episode and subscription list requests
This commit is contained in:
thrillfall 2021-08-12 23:13:05 +02:00 committed by GitHub
commit 0a62907b40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -98,7 +98,7 @@ class EpisodeActionController extends Controller {
* @return DateTime
*/
private function createDateTimeFromTimestamp(?int $since): DateTime {
return ($since)
return ($since !== null)
? (new \DateTime)->setTimestamp($since)
: (new \DateTime('-1 week'));
}

View File

@ -73,7 +73,7 @@ class SubscriptionChangeController extends Controller {
* @return DateTime
*/
private function createDateTimeFromTimestamp(?int $since): DateTime {
return ($since)
return ($since !== null)
? (new \DateTime)->setTimestamp($since)
: (new \DateTime('-1 week'));
}