diff options
Diffstat (limited to 'app/Controllers/categoryController.php')
| -rw-r--r-- | app/Controllers/categoryController.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/app/Controllers/categoryController.php b/app/Controllers/categoryController.php index 0ca1bbbcd..60685c566 100644 --- a/app/Controllers/categoryController.php +++ b/app/Controllers/categoryController.php @@ -79,6 +79,8 @@ class FreshRSS_category_Controller extends FreshRSS_ActionController { /** * This action updates the given category. + * @todo Check whether this function is used at all + * @see FreshRSS_subscription_Controller::categoryAction() (consider merging) * * Request parameters are: * - id @@ -97,14 +99,16 @@ class FreshRSS_category_Controller extends FreshRSS_ActionController { Minz_Request::bad(_t('feedback.sub.category.no_name'), $url_redirect); } - if ($catDAO->searchById($id) == null) { + $cat = $catDAO->searchById($id); + if ($cat === null) { Minz_Request::bad(_t('feedback.sub.category.not_exist'), $url_redirect); } - $cat = new FreshRSS_Category($name); - $values = array( + $values = [ 'name' => $cat->name(), - ); + 'kind' => $cat->kind(), + 'attributes' => $cat->attributes(), + ]; if ($catDAO->updateCategory($id, $values)) { Minz_Request::good(_t('feedback.sub.category.updated'), $url_redirect); |
