Просмотр исходного кода

Fix issue #88 : possibilité d'importer (OPML) des flux sans catégorie

Marien Fressinaud 12 лет назад
Родитель
Сommit
e5637cb1ed
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      lib/lib_rss.php

+ 5 - 2
lib/lib_rss.php

@@ -68,6 +68,9 @@ function opml_import ($xml) {
 		throw new OpmlException ();
 	}
 
+	$catDAO = new CategoryDAO();
+	$defCat = $catDAO->getDefault();
+
 	$categories = array ();
 	$feeds = array ();
 
@@ -99,8 +102,8 @@ function opml_import ($xml) {
 				$feeds = array_merge ($feeds, getFeedsOutline ($outline, $cat->id ()));
 			}
 		} else {
-			// Flux rss
-			$feeds[] = getFeed ($outline, '');
+			// Flux rss sans catégorie, on récupère l'ajoute dans la catégorie par défaut
+			$feeds[] = getFeed ($outline, $defCat->id());
 		}
 	}