Przeglądaj źródła

Bug affichage ID category introduit récemment

Alexandre Alapetite 12 lat temu
rodzic
commit
b99979cef7
2 zmienionych plików z 6 dodań i 3 usunięć
  1. 2 1
      app/Models/Feed.php
  2. 4 2
      app/Models/FeedDAO.php

+ 2 - 1
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)) {

+ 4 - 2
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'] : '');