Procházet zdrojové kódy

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 před 2 roky
rodič
revize
c49c29a561
1 změnil soubory, kde provedl 3 přidání a 0 odebrání
  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');
 			$outline['frss:cssFullContentFilter'] = $feed->attributes('path_entries_filter');
 		}
 		}
 
 
+		// Remove null attributes
+		$outline = array_filter($outline, static function (?string $value) { return $value !== null; });
+
 		$outlines[] = $outline;
 		$outlines[] = $outline;
 	}
 	}