Parcourir la source

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 il y a 2 ans
Parent
commit
c49c29a561
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  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;
 	}