aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/feedController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-12-27 15:18:36 +0100
committerGravatar GitHub <noreply@github.com> 2023-12-27 15:18:36 +0100
commitd65f77c081e756997e59e602f49eeea9b09799ff (patch)
tree0094569a28b089a90ce146ee3782cfbff4fc0be9 /app/Controllers/feedController.php
parente9689645383d37231afa9dbbcd9bd765b804046d (diff)
More robust assignment of categories to feeds (#5986)
Several minor cases, none of which should really be necessary Might help: https://github.com/FreshRSS/FreshRSS/issues/5981 https://github.com/FreshRSS/FreshRSS/issues/5982
Diffstat (limited to 'app/Controllers/feedController.php')
-rw-r--r--app/Controllers/feedController.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index cc560a224..be86afb2d 100644
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -64,7 +64,6 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
if ($cat === null) {
$catDAO->checkDefault();
}
- $cat_id = $cat === null ? FreshRSS_CategoryDAO::DEFAULTCATEGORYID : $cat->id();
$feed = new FreshRSS_Feed($url); //Throws FreshRSS_BadUrl_Exception
$title = trim($title);
@@ -74,7 +73,11 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
$feed->_kind($kind);
$feed->_attributes($attributes);
$feed->_httpAuth($http_auth);
- $feed->_categoryId($cat_id);
+ if ($cat === null) {
+ $feed->_categoryId(FreshRSS_CategoryDAO::DEFAULTCATEGORYID);
+ } else {
+ $feed->_category($cat);
+ }
switch ($kind) {
case FreshRSS_Feed::KIND_RSS:
case FreshRSS_Feed::KIND_RSS_FORCED: