Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
This commit is contained in:
Benjamin Brahmer 2022-08-19 11:26:04 +02:00
parent 1784406fa7
commit 410a1e4d6b
1 changed files with 7 additions and 12 deletions

View File

@ -91,19 +91,14 @@ class OPMLExporter
{ {
$feedOutline = $document->createElement('outline'); $feedOutline = $document->createElement('outline');
$attributes = [ $attributes = [
['title', $feed->getTitle()], 'title' => $feed->getTitle(),
['text', $feed->getTitle()], 'text' => $feed->getTitle(),
['type', 'rss'], 'type' => 'rss',
['xmlUrl', $feed->getUrl()], 'xmlUrl' => $feed->getUrl(),
['htmlUrl', $feed->getLink()], 'htmlUrl' => $feed->getLink(),
]; ];
foreach ($attributes as $name => $value) {
foreach ($attributes as $attribute) { $feedOutline->setAttribute($name, $value ?? '');
if (is_null($attribute[1])) {
$feedOutline->setAttribute($attribute[0], "");
} else {
$feedOutline->setAttribute($attribute[0], $attribute[1]);
}
} }
return $feedOutline; return $feedOutline;