mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-01-27 14:48:08 -05:00
Impossibilité d'ajouter une catégorie 'vide' + suppression des espaces en début et fin de chaîne
This commit is contained in:
@@ -17,7 +17,7 @@ class configureController extends ActionController {
|
||||
if (Request::isPost ()) {
|
||||
$cats = Request::param ('categories', array ());
|
||||
$ids = Request::param ('ids', array ());
|
||||
$newCat = Request::param ('new_category');
|
||||
$newCat = trim (Request::param ('new_category', ''));
|
||||
|
||||
foreach ($cats as $key => $name) {
|
||||
if (strlen ($name) > 0) {
|
||||
@@ -32,14 +32,17 @@ class configureController extends ActionController {
|
||||
}
|
||||
}
|
||||
|
||||
if ($newCat != false) {
|
||||
if ($newCat != '') {
|
||||
$cat = new Category ($newCat);
|
||||
$values = array (
|
||||
'id' => $cat->id (),
|
||||
'name' => $cat->name (),
|
||||
'color' => $cat->color ()
|
||||
);
|
||||
$catDAO->addCategory ($values);
|
||||
|
||||
if ($catDAO->searchByName ($newCat) == false) {
|
||||
$catDAO->addCategory ($values);
|
||||
}
|
||||
}
|
||||
|
||||
// notif
|
||||
|
||||
Reference in New Issue
Block a user