diff --git a/lib/Utility/OPMLExporter.php b/lib/Utility/OPMLExporter.php index bb813daf83..dddd7bc324 100644 --- a/lib/Utility/OPMLExporter.php +++ b/lib/Utility/OPMLExporter.php @@ -91,19 +91,14 @@ protected function createFeedOutline(Feed $feed, DOMDocument $document) { $feedOutline = $document->createElement('outline'); $attributes = [ - ['title', $feed->getTitle()], - ['text', $feed->getTitle()], - ['type', 'rss'], - ['xmlUrl', $feed->getUrl()], - ['htmlUrl', $feed->getLink()], + 'title' => $feed->getTitle(), + 'text' => $feed->getTitle(), + 'type' => 'rss', + 'xmlUrl' => $feed->getUrl(), + 'htmlUrl' => $feed->getLink(), ]; - - foreach ($attributes as $attribute) { - if (is_null($attribute[1])) { - $feedOutline->setAttribute($attribute[0], ""); - } else { - $feedOutline->setAttribute($attribute[0], $attribute[1]); - } + foreach ($attributes as $name => $value) { + $feedOutline->setAttribute($name, $value ?? ''); } return $feedOutline;