summaryrefslogtreecommitdiff
path: root/app/Models
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-27 14:11:17 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-27 14:11:17 +0100
commitb99979cef78f7cd0c1cb4ae81115d09881e85926 (patch)
tree7c8235198b6b587574b41175a167103d31740a9a /app/Models
parentab3cc9be569471b2bdc45ba2f095f621c5549143 (diff)
Bug affichage ID category introduit récemment
Diffstat (limited to 'app/Models')
-rw-r--r--app/Models/Feed.php3
-rw-r--r--app/Models/FeedDAO.php6
2 files changed, 6 insertions, 3 deletions
diff --git a/app/Models/Feed.php b/app/Models/Feed.php
index 0f467f776..32f8546dd 100644
--- a/app/Models/Feed.php
+++ b/app/Models/Feed.php
@@ -136,7 +136,8 @@ class FreshRSS_Feed extends Minz_Model {
$this->url = $value;
}
public function _category ($value) {
- $this->category = $value;
+ $value = intval($value);
+ $this->category = $value >= 0 ? $value : 0;
}
public function _name ($value) {
if (is_null ($value)) {
diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php
index d517f9580..e102da4ec 100644
--- a/app/Models/FeedDAO.php
+++ b/app/Models/FeedDAO.php
@@ -316,11 +316,13 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
$key = $dao['id'];
}
if ($catID === null) {
- $catID = isset($dao['category']) ? $dao['category'] : 0;
+ $category = isset($dao['category']) ? $dao['category'] : 0;
+ } else {
+ $category = $catID ;
}
$myFeed = new FreshRSS_Feed(isset($dao['url']) ? $dao['url'] : '', false);
- $myFeed->_category(intval($catID));
+ $myFeed->_category($category);
$myFeed->_name($dao['name']);
$myFeed->_website(isset($dao['website']) ? $dao['website'] : '', false);
$myFeed->_description(isset($dao['description']) ? $dao['description'] : '');