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

OPML export fix empty attributes (#5559)

Fix:
> Deprecated:  DOMElement::setAttributeNS(): Passing null to parameter #3 ($value) of type string is deprecated in /var/www/FreshRSS/lib/marienfressinaud/lib_opml/src/LibOpml/LibOpml.php on line 680
Alexandre Alapetite 2 лет назад
Родитель
Сommit
c49c29a561
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      app/views/helpers/export/opml.phtml

+ 3 - 0
app/views/helpers/export/opml.phtml

@@ -59,6 +59,9 @@ function feedsToOutlines(array $feeds, bool $excludeMutedFeeds = false): array {
 			$outline['frss:cssFullContentFilter'] = $feed->attributes('path_entries_filter');
 		}
 
+		// Remove null attributes
+		$outline = array_filter($outline, static function (?string $value) { return $value !== null; });
+
 		$outlines[] = $outline;
 	}