summaryrefslogtreecommitdiffstats
path: root/controller/itemcontroller.php
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-03-25 10:43:05 +0100
committerBernhard Posselt <nukeawhale@gmail.com>2013-03-25 10:43:05 +0100
commitdf07df3b29c1d08d0cadc6aa4b11ac82981d002b (patch)
tree4e7942982e78fb89091cd92134bf3a7b17fb06af /controller/itemcontroller.php
parent88d59427390298c7f118f591b70db51c088039ae (diff)
set last viewed feed type and id and added casts to int for parameters
Diffstat (limited to 'controller/itemcontroller.php')
-rw-r--r--controller/itemcontroller.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/controller/itemcontroller.php b/controller/itemcontroller.php
index ef7276eba..e3540cbab 100644
--- a/controller/itemcontroller.php
+++ b/controller/itemcontroller.php
@@ -52,15 +52,18 @@ class ItemController extends Controller {
$showAll = $this->api->getUserValue($userId, 'showAll') === 'true';
$limit = $this->params('limit');
- $type = $this->params('type');
- $id = $this->params('id');
+ $type = (int) $this->params('type');
+ $id = (int) $this->params('id');
+
+ $this->api->setUserValue($userId, 'lastViewedFeedId', $id);
+ $this->api->setUserValue($userId, 'lastViewedFeedType', $type);
if($limit !== null){
- $offset = $this->params('offset', 0);
- $items = $this->itemBl->findAll($id, $type, $limit, $offset,
+ $offset = (int) $this->params('offset', 0);
+ $items = $this->itemBl->findAll($id, $type, (int) $limit, $offset,
$showAll, $userId);
} else {
- $updatedSince = $this->params('updatedSince');
+ $updatedSince = (int) $this->params('updatedSince');
$items = $this->itemBl->findAllNew($id, $type, $updatedSince,
$showAll, $userId);
}
@@ -119,7 +122,7 @@ class ItemController extends Controller {
private function setRead($isRead){
$userId = $this->api->getUserId();
- $itemId = $this->params('itemId');
+ $itemId = (int) $this->params('itemId');
$this->itemBl->read($itemId, $isRead, $userId);
}
@@ -151,7 +154,7 @@ class ItemController extends Controller {
*/
public function readFeed(){
$userId = $this->api->getUserId();
- $feedId = $this->params('feedId');
+ $feedId = (int) $this->params('feedId');
$this->itemBl->readFeed($feedId, $userId);
}