From c67feb8d8d388e3b16603b2253ad7f86d8d72fd9 Mon Sep 17 00:00:00 2001 From: anoy Date: Fri, 15 Jan 2021 21:47:18 +0100 Subject: fix TypeError caused by type conversion in controller Signed-off-by: anoy --- lib/Controller/ItemApiController.php | 4 ++-- lib/Service/ItemService.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/Controller/ItemApiController.php b/lib/Controller/ItemApiController.php index c958324af..af36b87f0 100644 --- a/lib/Controller/ItemApiController.php +++ b/lib/Controller/ItemApiController.php @@ -93,14 +93,14 @@ class ItemApiController extends ApiController { // needs to be turned into a millisecond timestamp to work properly if (strlen((string) $lastModified) <= 10) { - $paddedLastModified = $lastModified . '000000'; + $paddedLastModified = $lastModified * 1000000; } else { $paddedLastModified = $lastModified; } $items = $this->oldItemService->findAllNew( $id, $type, - $paddedLastModified, + (int) $paddedLastModified, true, $this->getUserId() ); diff --git a/lib/Service/ItemService.php b/lib/Service/ItemService.php index 62a319346..8ba0a4b73 100644 --- a/lib/Service/ItemService.php +++ b/lib/Service/ItemService.php @@ -73,7 +73,7 @@ class ItemService extends Service * * @return array of items */ - public function findAllNew(?int $id, $type, $updatedSince, $showAll, $userId) + public function findAllNew(?int $id, $type, int $updatedSince, bool $showAll, string $userId) { switch ($type) { case FeedType::FEED: -- cgit v1.2.3