aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xapp/Controllers/feedController.php2
-rw-r--r--p/api/greader.php9
2 files changed, 5 insertions, 6 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index ca7a818c6..c2a22aeb3 100755
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -474,7 +474,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
}
public static function moveFeed($feed_id, $cat_id, $new_cat_name = '') {
- if ($feed_id <= 0) {
+ if ($feed_id <= 0 || ($cat_id <= 0 && $new_cat_name == '')) {
return false;
}
diff --git a/p/api/greader.php b/p/api/greader.php
index 8b1e0ffb1..4965ffd3b 100644
--- a/p/api/greader.php
+++ b/p/api/greader.php
@@ -323,13 +323,10 @@ function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = '
}
}
$cat = $categoryDAO->searchByName($c_name);
- $addCatId = $cat == null ? -1 : $cat->id();
+ $addCatId = $cat == null ? 0 : $cat->id();
} else if ($remove != '' && strpos($remove, 'user/-/label/')) {
$addCatId = 1; //Default category
}
- if ($addCatId <= 0 && $c_name == '') {
- $addCatId = 1; //Default category
- }
$feedDAO = FreshRSS_Factory::createFeedDao();
for ($i = count($streamNames) - 1; $i >= 0; $i--) {
$streamName = $streamNames[$i]; //feed/http://example.net/sample.xml ; feed/338
@@ -366,7 +363,9 @@ function subscriptionEdit($streamNames, $titles, $action, $add = '', $remove = '
break;
case 'edit':
if ($feedId > 0) {
- FreshRSS_feed_Controller::moveFeed($feedId, $addCatId, $c_name);
+ if ($addCatId > 0 || $c_name != '') {
+ FreshRSS_feed_Controller::moveFeed($feedId, $addCatId, $c_name);
+ }
if ($title != '') {
FreshRSS_feed_Controller::renameFeed($feedId, $title);
}