From 2ff422d3122ebb2e7c69986a8d6e3c4636bbab51 Mon Sep 17 00:00:00 2001 From: Marcus Rohrmoser Date: Tue, 8 Nov 2016 22:03:51 +0100 Subject: [PATCH] Revive enclosures.Reverts 0663c95. Refs #198 #175. --- formats/AtomFormat.php | 4 ++++ formats/MrssFormat.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/formats/AtomFormat.php b/formats/AtomFormat.php index b0db313..38e02e1 100644 --- a/formats/AtomFormat.php +++ b/formats/AtomFormat.php @@ -26,6 +26,9 @@ class AtomFormat extends FormatAbstract{ $entryUri = isset($item['uri']) ? $this->xml_encode($item['uri']) : ''; $entryTimestamp = isset($item['timestamp']) ? $this->xml_encode(date(DATE_ATOM, $item['timestamp'])) : ''; $entryContent = isset($item['content']) ? $this->xml_encode($this->sanitizeHtml($item['content'])) : ''; + $entryEnclosures = ""; + foreach($item['enclosures'] as $enclosure) + $entryEnclosures .= "xml_encode($enclosure)."\"/>"; $entries .= << @@ -37,6 +40,7 @@ class AtomFormat extends FormatAbstract{ {$entryUri} {$entryTimestamp} {$entryContent} + {$entryEnclosures} EOD; diff --git a/formats/MrssFormat.php b/formats/MrssFormat.php index 373c438..80d2b2b 100644 --- a/formats/MrssFormat.php +++ b/formats/MrssFormat.php @@ -30,6 +30,9 @@ class MrssFormat extends FormatAbstract { $itemUri = isset($item['uri']) ? $this->xml_encode($item['uri']) : ''; $itemTimestamp = isset($item['timestamp']) ? $this->xml_encode(date(DATE_RFC2822, $item['timestamp'])) : ''; $itemContent = isset($item['content']) ? $this->xml_encode($this->sanitizeHtml($item['content'])) : ''; + $entryEnclosures = ""; + foreach($item['enclosures'] as $enclosure) + $entryEnclosures .= ""; $items .= << @@ -39,6 +42,7 @@ class MrssFormat extends FormatAbstract { {$itemTimestamp} {$itemContent} {$itemAuthor} + {$entryEnclosures} EOD;