diff options
Diffstat (limited to 'src/Wallabag/ApiBundle')
-rw-r--r-- | src/Wallabag/ApiBundle/Controller/WallabagRestController.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index 744e1a60..fe3495f8 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php | |||
@@ -43,8 +43,8 @@ class WallabagRestController extends FOSRestController | |||
43 | { | 43 | { |
44 | $this->validateAuthentication(); | 44 | $this->validateAuthentication(); |
45 | 45 | ||
46 | $isArchived = (int) $request->query->get('archive'); | 46 | $isArchived = (null === $request->query->get('archive')) ? null : (bool) (int) $request->query->get('archive'); |
47 | $isStarred = (int) $request->query->get('starred'); | 47 | $isStarred = (null === $request->query->get('starred')) ? null : (bool) (int) $request->query->get('starred'); |
48 | $sort = $request->query->get('sort', 'created'); | 48 | $sort = $request->query->get('sort', 'created'); |
49 | $order = $request->query->get('order', 'desc'); | 49 | $order = $request->query->get('order', 'desc'); |
50 | $page = (int) $request->query->get('page', 1); | 50 | $page = (int) $request->query->get('page', 1); |
@@ -52,7 +52,7 @@ class WallabagRestController extends FOSRestController | |||
52 | 52 | ||
53 | $pager = $this->getDoctrine() | 53 | $pager = $this->getDoctrine() |
54 | ->getRepository('WallabagCoreBundle:Entry') | 54 | ->getRepository('WallabagCoreBundle:Entry') |
55 | ->findEntries($this->getUser()->getId(), (bool) $isArchived, (bool) $isStarred, $sort, $order); | 55 | ->findEntries($this->getUser()->getId(), $isArchived, $isStarred, $sort, $order); |
56 | 56 | ||
57 | $pager->setCurrentPage($page); | 57 | $pager->setCurrentPage($page); |
58 | $pager->setMaxPerPage($perPage); | 58 | $pager->setMaxPerPage($perPage); |