From 858165736bf14d95fcfcb6e3c1fa7dce2ea79302 Mon Sep 17 00:00:00 2001 From: gulch Date: Thu, 31 Mar 2016 11:44:15 +0300 Subject: [PATCH] Add support of valid 'enclosure' element --- src/Thujohn/Rss/Rss.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Thujohn/Rss/Rss.php b/src/Thujohn/Rss/Rss.php index e0fa690..b1e69f1 100644 --- a/src/Thujohn/Rss/Rss.php +++ b/src/Thujohn/Rss/Rss.php @@ -117,7 +117,14 @@ public function render() } else { - $elem_item->addChild($options[0], $vI); + if (is_array($vI)) { + $item_child = $elem_item->addChild($options[0]); + foreach ($vI as $key => $value) { + $item_child->addAttribute($key, $value); + } + } else { + $elem_item->addChild($options[0], $vI); + } } } }